Created
August 12, 2013 12:26
-
-
Save vanjikumaran/6210394 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.*; | |
| /** | |
| * Created with IntelliJ IDEA. | |
| * User: vanji | |
| * Date: 5/17/13 | |
| * Time: 9:31 AM | |
| * To change this template use File | Settings | File Templates. | |
| */ | |
| public class Client{ | |
| public static void main(String[] args) throws Exception | |
| { | |
| Socket socket = new Socket(InetAddress.getByName("localhost"), 12345); | |
| InputStream in = socket.getInputStream(); | |
| int c; | |
| while ((c = in.read()) != -1) | |
| { | |
| System.out.write(c); | |
| } | |
| System.out.flush(); | |
| // should now be in CLOSE_WAIT | |
| Thread.sleep(Integer.MAX_VALUE); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment