Archived

This topic is now archived and is closed to further replies.

Fratt

just wanna know

Recommended Posts

hello, first, is there any same protocol for windows and linux ? i''ve seen that winsock.h is fairly the same as socket.h for linux. so you agree with that ? second, how do you do that ? do you use thread for posting your socket sending and receiving ? thanx a lot Fratt

Share this post


Link to post
Share on other sites
quote:
Original post by Fratt
is there any same protocol for windows and linux ?
i''ve seen that winsock.h is fairly the same as socket.h for linux.

so you agree with that ?


Yes. Berkeley sockets will work in almost the same way on both Linux and Windows. There are a few minor differences (e.g. close() versus closesocket()), but overall, you can write reasonably portable code with sockets.
quote:

how do you do that ? do you use thread for posting your socket sending and receiving ?


You can use threads if you want. You can also use non-blocking or asynchronous sockets.

I would recommend having a look at this site, as it has a fair bit of detailed information on socket programming.

Share this post


Link to post
Share on other sites