Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TCPServer {
- public static void main(String args[]) throws IOException {
- ServerSocket server = new ServerSocket(5020);
- Socket client = null;
- while (true){
- client = server.accept();
- Thread t = new ClientThread(client);
- t.start();
- }
- }
- }
- class ClientThread extends Thread {
- private Socket client;
- public ClientThread(Socket client){
- this.client = client;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment