sockets/c++/real time game/accept()
quote:Original post by Anonymous Poster
UDP is is a very simple low level protocol; it simply sends a fixed size packet via a known route to the other end.
AFAIK every UDP datagram is routed independently of other datagrams.
And ''lose'' has only one o in it.
OK, but imagine my server is constantly running.. and i want to take connections from clients as they come.. surely i can''t use recvfrom until i know where it''s going to come from..... and i cant know that until i recvfrom someone.
stu
stu
This is why I don''t like sockets. When it comes to threading and accepting more clients at once, you HAVE to build a system around it.
Short answer, create a system that manages SOCKETs and for every SOCKET you have to create a thread that recv()''s fromt that SOCKET.
--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..
Short answer, create a system that manages SOCKETs and for every SOCKET you have to create a thread that recv()''s fromt that SOCKET.
--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..
The address argument to recvfrom() tells you who sent the data, it does not select who to receive data from. For more information, I suggest googling, MSDN, or reading the man page.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement