Created
August 1, 2012 15:29
-
-
Save ramalho/3227818 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
| package br.com.globalcode.aj4.net; | |
| import java.net.*; | |
| import java.io.*; | |
| public class ClientSocket { | |
| public static void main(String args []) throws Exception { | |
| BufferedReader leitorLinhas; | |
| InputStreamReader leitorCaracteres; | |
| InputStream leitorSocket; | |
| Socket s = new Socket("localhost", 8080); | |
| leitorSocket = s.getInputStream(); | |
| leitorCaracteres = new InputStreamReader(leitorSocket); | |
| leitorLinhas = new BufferedReader(leitorCaracteres); | |
| System.out.println(leitorLinhas.readLine()); | |
| s.close(); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment