FH-Hof Kommunikation über das Internet - Beispiel für einen Server public class TestServer { public static void main(String[] args) throws IOException { ServerSocket seSocket = new ServerSocket(1704); Socket clSocket = seSocket.accept(); PrintStream out = null; BufferedReader in = null; out = new PrintStream(clSocket.getOutputStream()); in = new BufferedReader( new InputStreamReader( clSocket.getInputStream())); String inputLine = in.readLine(); System.out.println(inputLine); out.close(); in.close(); clSocket.close(); seSocket.close();}}
{}