Cool, thanks for the help guys...
I've come up with this general idea for handling everything. In games, the way they are generally setup is to perform the same tight loop over and over. Being something along the lines of:
Perhaps slightly more complicated
Loop While Running
So, I've decided to go in the Win32 direction with this project of mine and incorporate a similar loop:
Pretty fancy eh? MainWindow is my class created for handling, you guess it, the window. And MyWinsock handles all Winsock related issues. Here are the "Ticks":
while(MainWindow.bRunning == true)
SetFocus(hWnd); //Set Focus on the Main Window
if(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE) != 0) //DO WE HAVE ANY MESSAGES WAITING
TranslateMessage(&Msg); //CONVERT OUR VIRTUAL-KEY MESSAGE INTO A CHARACTER MESSAGE
DispatchMessage(&Msg); //SEND THE MESSAGE TO OUR MISC. MESSAGE HANDLER
//THERE WAS NO MESSAGE
//UPDATE THE WINDOW
Now, the order of those may be shuffled around a bit depending on the time that it'll take/how important they end up being (I'm relatively new with this, so I'm not sure yet). And of course, more functions may be added.
PingExistingConnections(); //Closes any useless connections
CheckForNewConnections(); //Accept any new connections
ReceiveMessages(); //Interpret Incoming Data
I guess my biggest question right now would be, since accept() is such a jerk and causes the machine to hang if there are no incoming connections, is there a way, kind of how like PeekMessage() tells me if a message is waiting, to check quickly whether or not there is an incoming connection waiting?
My whole plan here is relying on there actually being such a function. I sure hope somebody can shed some light here...