Results 1 to 2 of 2
- 10-25-2010, 11:11 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
Single server, multiple clients - JAVA sockets, No threads
Hi All,
I need a help, I got struck with my code. plZ help me. My project deals with single server handling multiple clients using sockets in java. And I am not using Threads anymore, want to execute the client requests sequentially in the server. I don't know how to implement this server, by listening always for multiple clients and executing them individually, Plz give some ideas and algorithm steps.
here is the sample
//*****************************
try {
serverSocket = new ServerSocket(port);
} catch (IOException e) {
System.err.println("Could not listen on port: current port");
System.exit(1);
}
try{
while(true)
client = serverSocket.accept();
} catch (IOException e) {
System.out.println("Accept failed Server: current port");
System.exit(-1);
}
//**********************
Thanks in advance,
Sadish
-
Similar Threads
-
Multiple Sockets on a single Port
By Sajith in forum NetworkingReplies: 2Last Post: 08-16-2010, 06:31 PM -
how to connect a server to multiple clients?
By azhar in forum NetworkingReplies: 15Last Post: 03-22-2010, 12:54 PM -
[SOLVED] Multiple client single server problem(it hangs halfway)
By kellaw in forum Advanced JavaReplies: 1Last Post: 10-02-2008, 07:03 PM -
[SOLVED] Multiple client single server problem(it hangs halfway)
By kellaw in forum NetworkingReplies: 1Last Post: 10-02-2008, 07:02 PM -
[SOLVED] Multiple client single server problem(it hangs halfway)
By kellaw in forum New To JavaReplies: 1Last Post: 10-02-2008, 07:01 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks