Jump to content
  • Advertisement
Sign in to follow this  

winsock - dealing with errors

This topic is 2806 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For a bit of info I'm using Async TCP and here's my networking code in it's entirety, excluding the header file which basically includes just the functions prototypes and the "Socket" and "client_data_struct" structs:

Message handling:

case FD_CONNECT: connected(WSAGETSELECTERROR(lParam)); break;//successfully connected to server (client)
case FD_ACCEPT: accept_connection(); break;//recieved connect attempt (server)
case FD_CLOSE: close_connection(wParam, WSAGETSELECTERROR(lParam)); break;//socket closed (server)
case FD_READ: recieve_data(wParam); break;//data recv'd wparam=socket (both)

networking code:

So yeah I was just wanting tips on how to deal with the errors, and also any tips on how to improve the code for error checking in general would be great. Also are there any noticeable problems/instabilities in my code? (note it's all working fine except that my code doesn't really handle errors, I have used to send and receive data across a network)

edit: Okay it seems nobody is interested in helping with generic issues like this, I admit it's not a direct problem with a simple answer. I just wanted to hear some helpful tips and stuff and confirmation that my networking code is at least okay (it works well enough so far). Whatever it's not essential and I was going to go ahead with it regardless, if you want to use my code feel free.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!