Sign in to follow this  
Kewley

WinSock Cross-Platform Alternative?

Recommended Posts

Kewley    122
Hi, I'm currently learning OpenGL, and making a basic Pong game. I was planning on making it multi-player using WinSock, however I am wondering if there is a Cross-Platform alternative to WinSock that I could use instead? Any help is greatly appreciated!

Share this post


Link to post
Share on other sites
ENet is a free open-source cross-platform UDP networking library with a socket interface, its quite easy and simple to use too, so you might want to take a look at its socket interface. AFAIK, it shouldnt have much of a difference from winsock.

Good luck with your projects!

EDIT: To make it clear, its socket interface works for both TCP and UDP

Share this post


Link to post
Share on other sites
Kewley    122
Thanks to both of you!

I'm gonna try Enet first as it seems to be what I was looking for, if not I'll take a look at the forum FAQ.

Thanks again.

Share this post


Link to post
Share on other sites
Evil Steve    2017
You can use the plain BSD sockets, which is pretty much the normal Winsock functions that aren't prefixed with WSA* (E.g. select(), send(), recv(), socket(), etc). You'll still need to call WSAStartup and WSACleanup in Windows builds, but that shouldn't be too bad.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this