Archive for June 10th, 2013

Java Program 18 – Client Server Network Program

Program

Client Program

————————–

import java.net.*;
import java.io.*;

public class Server{

ServerSocket server=null;

public Server(){

    try{

        server=new ServerSocket(1001);
        processRequest();
        
    }catch(Exception e){System.out.println(e);}
    

}

public void processRequest(){

while(true){

        try{

            Socket client=server.accept();

            NewSocket Client=new NewSocket(client);

        }
        catch(Exception ee){System.out.println(ee);}

}
    

}
public static void main(String args[]){

    new Server();

}

Read more »

Last updated by at .