Skip to content

Instantly share code, notes, and snippets.

@ramalho
Created August 1, 2012 15:29
Show Gist options
  • Select an option

  • Save ramalho/3227818 to your computer and use it in GitHub Desktop.

Select an option

Save ramalho/3227818 to your computer and use it in GitHub Desktop.
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