Original Post
..or something along those lines. After searching 8 pages back and the fairly unresponsive Google-gamedev.net search gimmick, I caved in and wrote up a new thread. :) With the basework done on my current project, it's finally time to move on to networking the confangled thing. My development language is Delphi, so I don't have the same luxury of having a slew of networking libraries whimsically lined up for me. There are a few, but I've decided to take the high-road and write my own server/client network code with vanilla Winsock. (Or is that the low-road?) And so, I present the curious passerby with a few questions about UDP that I'd like to know before I really get going with my coding adventures. Off we go! :) 1) Are there any speed/performance issues in using send()/recv() after connect()ing as opposed to sendto()/recvfrom()? Or is the different only syntactical? 2) For the server end of a UDP-based program, what method is the most efficient? From the top of my head, there's the select() route with FD_SET's, WSAAsyncSelect() via Win32 messages, blocking with multithreading (which I've heard is not quite wise :P), and I've seen a mentioning of just running a recvfrom() constantly to handle in all packets from all users, at one point. Not sure on that one. I'm just looking for the most speed-effective route for a server that will be handling up to a maximum of ~32 players. 3) Is broadcasting with UDP particularly effective, or is broadcasting only send it over the local network? I'm a bit foggy on how this works. And is this related to multiplexing in some form? 4) On the client end of this UDP-hodgepodge, I need an equally efficient method of getting data from the server, and sending it out. Would a blocking thread be affordable here, since it's only one socket, or is that still unpreferrable compared to the alternatives? What ARE the alternatives in this case? :) 5) I'm aware that when sending data via TCP all of the data is oftentimes not sent; that you need to continuously loop through and ensure that everything is passed over the network. UDP works on datagrams, so does this mean that if you perform a send the entire packet will be send, and no possibility of just a fragment? When receiving, is this also the case? 6) What's a reasonable number of packets for a server to be sending out per second? Heck, for just bouncing player movement (assuming I'm sending 2 per second) that's received to all players, with 20 players, that's 40 sends per second to 19 players. That's 760 packets per second! :-x Is this reasonable, or is there a better way to be handling this? Phew, that should cover the bulk of it. Any advice, ideas, cookies, and the like are all welcome. Thanks! :)