• Post Reply Bookmark Topic Watch Topic
  • New Topic

UDP socket

 
C Munro
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, how do you write an object oriented UDP client that receives message from multiple ip addresses? For example, I have a program that creates an object for every destination ip address. so, 111.222.333.444 is one object and 111.222.333.555 is another object. Both wait to receive messages on the same port. I notice that object for the ip address 111.222.333.444 sometimes receive the message meant for 111.222.333.555.
This is caused by the fact that there is a thread that continually waits to receive something on in both objects for the same port. Hence either object can receive the message.
Any suggestions?
 
C Munro
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I guess the real question is: how do you properly write an object oriented program for a UDP connection that sends and receives messages from different IP addresses?
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!