i have written a multithreaded client-server application in which i need to handle only one client at a time,is there any means by which we can connect to particular client from the server,once the server is finished with that particular client it should be able to switch to another client for communication for example transfer of data,files etc.
1 Replies - 1032 Views - Last Post: 30 November 2009 - 04:56 PM
#1
connecting to a single client in a multithreaded client server applica
Posted 30 November 2009 - 07:41 AM
Replies To: connecting to a single client in a multithreaded client server applica
#2
Re: connecting to a single client in a multithreaded client server applica
Posted 30 November 2009 - 04:56 PM
keep your multithread server
have a flag if server is connected or not
if already connected to a client stack the connection request to an Array/ArrayList/Vector
when you will be done with the actual client retreive the next connection request from the Array/ArrayList/Vector
process that client
p.s.
don't really think your clients will be happy to be in a queue waiting to be answered
why can't you process the whole thing in a multitrhead environment ? That is the definition of what a server is
have a flag if server is connected or not
if already connected to a client stack the connection request to an Array/ArrayList/Vector
when you will be done with the actual client retreive the next connection request from the Array/ArrayList/Vector
process that client
p.s.
don't really think your clients will be happy to be in a queue waiting to be answered
why can't you process the whole thing in a multitrhead environment ? That is the definition of what a server is
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|