1 Replies - 1249 Views - Last Post: 30 November 2009 - 04:56 PM Rate Topic: -----

#1 roshan joshi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-November 09

connecting to a single client in a multithreaded client server applica

Post icon  Posted 30 November 2009 - 07:41 AM

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.
Is This A Good Question/Topic? 0
  • +

Replies To: connecting to a single client in a multithreaded client server applica

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8328
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1