import java.util.*; import java.net.*; import java.io.*; public class lab3Server{ public static void main (String args[]) throws Exception { ServerSocket ss = new ServerSocket (3141); System.out.println ("Waiting for connection:"); Socket soc = ss.accept(); System.out.println ("Got connection: "+soc.toString()); OutputStreamWriter w = new OutputStreamWriter (soc.getOutputStream()); w.write ("Hello, World!"); w.flush(); w.close(); soc.close(); } }