Jump to content
  • Advertisement
Sign in to follow this  
jeffreyp23

Choosing a network library

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

Hello,

I wan't to learn networking but i can't decide which library i should use. I'm on windows(7) and it doesn't need to be
cross-platform. Also i want it to be low-level(as this is for learning purpose) but i can't find anything good.
Most people saying that i should avoid Winsock. I did a quick google search and i read on the microsoft website
about another networking api that is called Network Direct. Is this a good network api for game development?
Couldn't find much information about it. Also it seems that it is a sort of replacement for winsock?

I already checked out boost asio but i prefer to avoid it.

Thanks in advance

(I did check out the FAQ) Edited by Jeffreyp

Share this post


Link to post
Share on other sites
Advertisement
I'm not familiar with Network Direct, but from what I have read it seems to be a hardware vendor interface so it's probably way too low level.
Winsock is as low level as you should go.
If others say you should avoid winsock, it's probably because there exist many higher level apis that can do a lot of work for you.

Share this post


Link to post
Share on other sites

I'm not familiar with Network Direct, but from what I have read it seems to be a hardware vendor interface so it's probably way too low level.
Winsock is as low level as you should go.
If others say you should avoid winsock, it's probably because there exist many higher level apis that can do a lot of work for you.


Oke so if i would choose Winsock,
It will not be removed(it isn't deprecated) in future versions of windows?(like windows 8?)

Share this post


Link to post
Share on other sites
Have you checked out Raknet they have a hobbiest license that allows you to use it for free as long as you don't sell your app for a certain amount but those specifications are under the licensing tab.

Share this post


Link to post
Share on other sites
Winsock version 2.2 will be around forever. Everything is using it.
There are good and bad parts about WinSock. You don't want to use WSAAsyncSelect() or WSAEventSelect(), for example!
Instead, you should use OVERLAPPED I/O on the socket (sockets are file handles since Windows NT)
You can then use GetQueuedCompletionStatus() and similar functions to do overlapped/asynchronous I/O on the sockets with I/O completion ports. That's the "best" way to do sockets on Windows (but not the easiest.)

If you want a different library, and are OK with C++, I recommend boost::ASIO.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!