Alright, I'm going to be programming a multiplayer aspect into my game pretty soon. I want the game to be compatible with Linux, so I would prefer to use a cross platform networking API. I've done some Winsock2 before... Is there any alternative to Winsock2 that is usable with Linux? I don't want to leave Linux users in the dust. D:
What I'm looking for is something that is as simple/easy as Winsock2, yet meets my needs. Basically, the server will be receiving several chat messages from several different users, then sending these messages to the other connected clients. The server will be doing the same thing with basic packets, which contain information about what a certain player is doing at a certain time. For instance, "PLAYER_MOVE_RIGHT" or something similar to it. There could possibly be several other actions that the server would need to send. With the server doing all of these actions, I'd like to have 0-64 players connected at a time, preferably without much lag.
I also would like to know whether a TCP connection would be able to handle this, for I only know how to do TCP with Winsock; I have never done UDP before.
But yeah, those are basically the things I need the server to perform.
I could have taken your reply wrong, so just ask if you need any questions answered.
EDIT:
If you've never used Winsock 2, it's basically made up of basic functions like send(), recv(), accept(), etc. I don't know how much that helps you, hopefully a bit.
Maybe you think of something like SimpleSockets or lwIP as a separate library to include. But since Winsock is based on Berkeley and the functions are the same you just should put some defines around the WSADATA and WSAStartup to make it work.
Winsock2 is not cross-platform. There are subtle differences but WinAPI actually includes *wrapper* functions itself which resembles BSD sockets. It still requires startup and shutdown functions not standard in BSD sockets.
Regardless, using BSD sockets feels non-intuitive. There are plenty of C++, C, D, Python, Bash, <insert language here> wrappers available. I really do suggest against using BSD sockets directly, it complicates life.