Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ridcully

network programming using winsock

This topic is 6927 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

i am absolutely new to networking, and i decided to start with learning how to use winsock. so i have some (well, rather many) questions and would be glad if someone could try to answer them. first, is winsock the api i should use? ARE there any other? (i think dplay does use winsock, does it?) i am using unblocking sockets and simple send/recv calls, is this the right way to do it? seems a bit complicated to me, always having to listen and simutanously trying to send something (impossible with blocking sockets, right?) so any other way to do it? what sockets over the net are guaranteed to work? is this also dependant from my isp? and last: i heard about using UDP for game programming, what the hell is that? thanks ridcully

Share this post


Link to post
Share on other sites
Advertisement
>>> first, is winsock the api i should use? ARE there any other? (i think dplay does use winsock, does it?) <<<

For windows, thats pretty much your only choice. Dplay is built on top of WinSock. But it''s a pretty nice API as long as you use it correctly, although it''s not perfect.

>>> i am using unblocking sockets and simple send/recv calls, is this the right way to do it? seems a bit complicated to me, always having to listen and simutanously trying to send something (impossible with blocking sockets, right?) so any other way to do it? <<<

The best WinSock operation mode IMHO is async mode. Much less headache than blocking and non-blocking modes. Has your book discussed it yet?

>>and last: i heard about using UDP for game programming, what the hell is that? <<<

It stands for User Datagram Protocol (if I''m remembering correctly). It''s fast, but the packets aren''t guarented to get to their destination, or get there in sync (i.e. they might get lost in the routers). Still, guarenteed delivery in a game isn''t usually needed anyway since if you lose a packet you can just update when the next one gets there.

BTW, I''m also just beginning to learn WinSock, so don''t take my word as 100% correct .

--TheGoop

Share this post


Link to post
Share on other sites
I''ll just ask here, seeing as I''ve been meaning to get into this for a long time - can anyone recommend any resources to learn network programming (i.e. winsock) I can get dplay stuff, but if theres a site/book anyone knows of, please tell me.

-Mezz

Share this post


Link to post
Share on other sites
A good book to start with for Winsock programming is "Winsock 2" by Lewis Napper. The book''s website is www.sockaddr.com, if you want to look at the sample code first.

Share this post


Link to post
Share on other sites

  • 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!