sockets/c++/real time game/accept()

Started by
13 comments, last by Dunge 19 years, 11 months ago
Thnx a lot, I''m gonna try it right now.
Advertisement
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
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..
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.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement