2 serverSocket accept( )in the same class without blocking?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: 2 serverSocket accept( )in the same class without blocking?

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    2 serverSocket accept( )in the same class without blocking?

    Hello,
    if anyone could help me with this problem i would be very thankful since i have been trying to figure it out for days.

    Basically i have a main server which has 2 serversocket connections both 'listening' for data on a specific port using the 'accept()' method, then when a connection is recieved they do something.

    what i have notice is that the first accept( ) blocks, so the other accept has no chance of listening for a connection until the first is finished.

    I have looked at sockets channels and non bocking with them , but this all seems to complicated , Is there anyway at all to get the 2 conections to run concurrently on my current model????

    thanks in advance for any help

  2. #2
    Join Date
    Mar 2005
    Location
    UK, London
    Posts
    150
    Are you using threads?

  3. #3
    Join Date
    Apr 2006
    Posts
    2

    Re: 2 serverSocket accept( )in the same class without blocking?

    yes, once the connection from a client is accepted it starts off a new thread( this is true for both server sockets).

Similar Threads

  1. JDOM Classpath Help Required
    By kpandya in forum Java
    Replies: 5
    Last Post: 01-15-2006, 08:10 PM
  2. Help with class/applet
    By none_none in forum Java
    Replies: 17
    Last Post: 04-28-2005, 04:00 PM
  3. Replies: 5
    Last Post: 04-27-2005, 07:07 PM
  4. Replies: 5
    Last Post: 10-17-2002, 02:58 PM
  5. Assembly class
    By Shailesh C.Rathod in forum .NET
    Replies: 2
    Last Post: 03-13-2002, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center