Jump to content
  • Advertisement
Sign in to follow this  
FreJa

problems with java networking

This topic is 3607 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, So I have 3 threads. In one of these threads I'm constantly calling receive on a UDP socket. On the other two I'm waiting with accept. Problem is, when receive times out, and launches SocketTimeoutException, IF I'm doing accept on one of the other two threads, the thread doing accept is suspended and the exception is handled (on the other thread)... Of course, I don't want this, I want to keep my accept running till the end. Any ideas? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
So you have 3 sockets? 1 DatagramSocket and 2 ServerSockets?

I'm not really sure how accept() could impact UDP socket.

Share this post


Link to post
Share on other sites
accept() is specific to TCP. You should be calling recvfrom() on a single socket when using UDP -- all remote clients will be sending to the same port and the same socket, and your server tells them apart by looking at the address you get out of recvfrom().

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!