Jump to content

  • Log In with Google      Sign In   
  • Create Account


Sockets in general


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 gimp   Members   -  Reputation: 142

Like
Likes
Like

Posted 27 April 2000 - 07:09 PM

I was wondering, do any of you guys have experience with writing Win AND Unix sockets apps? Just a curious question as I''m about to start working on my multiplayer code and wan''t to make sure I don''t paint myself in to a corner for when it comes time to port the code to linux. Are there any thing''s I shouldn''t do with winsock that''ll make it harder to convert later? Is there anything I shouldn''t do in C++ like using basic_strings etc? chris

Sponsor:

#2 Buster   Members   -  Reputation: 100

Like
Likes
Like

Posted 27 April 2000 - 08:01 PM

If you are using WinSock, it''s the exact same sockets as Unix (all Berkeley).

#3 Yanroy   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 April 2000 - 04:19 AM

I came along just in time... I have the same question. I heard somewhere that you can''t use WSAStartup() with linux, is that true?

--------------------


You are not a real programmer until you end all your sentences with semicolons;

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.


#4 SiCrane   Moderators   -  Reputation: 9492

Like
Likes
Like

Posted 28 April 2000 - 06:37 AM

Any function beginning with WSA is Winsock specific, i.e. not in Berkely sockets. Because of the tight integration of the Berkeley socket architecture with the UNIX architecture it''s not necessary to perform the same kind of initialization with Berekley sockets. Berekley sockets are acutal file descriptors, Winsock sockets are essentially Window''s HANDLES.

To make it easier to code for linux later, don''t use WSAAsyncSelect. select or WSAEventSelect is fine, especially if multi-threading. However your WSAEventSelects will have to replaced by select statements, and you''ll block on those rather than on the event objects. Stick with standard I/O functions, send(), recv(), sendto(), recvfrom(), as the overlapped and extended versions aren''t available on UNIX boxes. Also note that FD_SET is a structure in Windows but is a typedef of a primitive type in UNIX.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS