Skip to content

Instantly share code, notes, and snippets.

@nazt
Created December 30, 2009 16:48
Show Gist options
  • Save nazt/266173 to your computer and use it in GitHub Desktop.
Save nazt/266173 to your computer and use it in GitHub Desktop.
// HelloServer.java
import java.io.*;
import java.net.*;
class HelloServer {
public static void main(String args[]) throws Exception {
ServerSocket ss = new ServerSocket(12345);
System.out.println("Server is created.");
Socket s = ss.accept();
PrintStream op = new PrintStream(s.getOutputStream());
op.println("Hello! how do you do?");
s.close();
ss.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment