Last active
August 29, 2015 14:13
-
-
Save revox/21b37f7895f9f098deaa 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 evenSimplerEchoClient | |
| { | |
| public static void main(String[] argv) throws Exception | |
| { | |
| Socket s = new Socket("localhost",5000); | |
| OutputStream p =s.getOutputStream(); | |
| InputStream i = s.getInputStream(); | |
| InputStreamReader b = new InputStreamReader(System.in); | |
| int c; | |
| while((c=b.read())!=-1) { | |
| p.write(c); | |
| p.flush(); | |
| System.out.print((char)i.read()); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment