DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006

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

    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
    UK, London
    Are you using threads?

  3. #3
    Join Date
    Apr 2006

    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, 07:10 PM
  2. Help with class/applet
    By none_none in forum Java
    Replies: 17
    Last Post: 04-28-2005, 03:00 PM
  3. Replies: 5
    Last Post: 04-27-2005, 06:07 PM
  4. Replies: 5
    Last Post: 10-17-2002, 01:58 PM
  5. Assembly class
    By Shailesh C.Rathod in forum .NET
    Replies: 2
    Last Post: 03-13-2002, 07: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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.