Last active
August 29, 2015 14:13
-
-
Save revox/9b122aa9ac5fc6df8f7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.net.*; | |
| class evenSimplerEchoServer | |
| { | |
| public static void main(String[] argv) throws Exception | |
| { | |
| ServerSocket s = new ServerSocket(5000); | |
| Socket t = s.accept();//wait for client to connect | |
| InputStream b = t.getInputStream(); | |
| OutputStream p = t.getOutputStream(); | |
| int c; | |
| while((c=b.read())!=-1) { | |
| p.write(c); | |
| p.flush(); | |
| System.out.print((char) c); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment