Skip to main content
GameDev.net gamedev.net
🔒 Locked

winsock alternatives?

Started by nyt3hawk Dec 15, 2005 at 6:21 PM 4 replies 3.1k views
Original Post
nyt3hawk
nyt3hawk
is winsock the only way to do socket programming on windows? i know they have higher level layers that can be used such as enet. but i'm asking because i'd like to stay away from the WSA stuff if it is possible and make it easily portable to linux.
hplus0603
hplus0603
You can use the Linux-like functions out of winsock: socket(), bind(), and friends. You only need to call WSAStartup().

For a header file that isolates some of the differences that are still in the WinSock API, look at the HTTP-GET example; the sock_port files.
enum Bool { True, False, FileNotFound };
pwebrick
pwebrick
try looking at the socket.h file for networking in C\C++ in unix
a link is below for the specifications

http://www.opengroup.org/onlinepubs/007908799/xns/syssocket.h.html
PwebrickDeveloper - Looking for work in gaming industry
Will F
Will F
SDL_net is another alternative. If you're planning on porting your game over to linux SDL might be helpful.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.