Choosing a network library

Started by
4 comments, last by jeffreyp23 11 years, 10 months ago
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)
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.

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?)
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.
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.
enum Bool { True, False, FileNotFound };
Oke thanks. I will use winsock because i already got experience with it : )

This topic is closed to new replies.

Advertisement