network programming using winsock
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
>>> 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
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
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
-Mezz
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement