Thread: Cross Platform Socket Programming?

  1. #1
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254

    Cross Platform Socket Programming?

    I've been doing C++ for several weeks, and find it a refreshing change over high level languages. Just about everything is great, except for lack of information on cross platform sockets. I've seen several libraries such as SDL_Net, but what is the standard socket library used for a cross-platform application (Windows, Linux) ?

  2. #2
    *this
    Join Date
    Mar 2005
    Posts
    498
    Sorry to be off topic but C++ is a high level language.

    Check tutorials, they use winsock.

  3. #3
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    Sorry, I meant to say higher level languages. I know that C++ is high level, but I meant in comparison to the likes of Python or VB. Maybe I'm missing something, but Winsock stands for Windows Socket. From what I've seen on google, Winsock is for Windows, and is not available on Linux or Mac OSX, hence the name. So, is Winsock actually cross-platform, and if so, can you point me to a link which has the header files for non Windows operating systems, and if not, can you point me to a commonly used cross-platform socket library?
    Last edited by CrazyNorman; 07-15-2005 at 10:54 AM. Reason: spelling mistake

  4. #4
    *this
    Join Date
    Mar 2005
    Posts
    498
    O right cross...forgot you said that.

    Check out this tutorial:
    http://www.ecst.csuchico.edu/~beej/g...tml/index.html

  5. #5
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    I never realized how similar Unix sockest were to Winsock. Thanks for everything.

  6. #6
    Registered User
    Join Date
    Jul 2005
    Posts
    7
    BSD pretty much invented TCP/IP, so you can count on that being portable, but anything else(eg raw sockets) is going to be a little technical ****er.


    Windows even includes a BSD copyright in it. At least in 98 it did
    Last edited by karlan; 07-15-2005 at 04:49 PM.

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    Their are a few differences, but their are some crossplatform libs out there, that can take care of it for you. Common C++ is one that I have looked at, and I know wxwidgets includes some socket classes as well.

    Also, even between various OS's, you can find differences, such as between FreeBSD, OpenBSD, Solaris, Linux, etc, they all have little differences. Thats one of the things I have learned about with reading Unix Network Programming.
    Last edited by Xipher; 07-15-2005 at 11:32 PM.
    If any part of my post is incorrect, please correct me.

    This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.

  8. #8
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    Thanks for the pointers. I'll look into those too.

  9. #9
    Registered User
    Join Date
    Jun 2005
    Location
    Stockholm, Sweden
    Posts
    64
    Quote Originally Posted by karlan
    BSD pretty much invented TCP/IP, so you can count on that being portable, but anything else(eg raw sockets) is going to be a little technical ****er.


    Windows even includes a BSD copyright in it. At least in 98 it did
    Windows includes the BSD TCP/IP stack, I don't think this has changed or is likely to change any time soon.

    That is the reason for the BSD copyright notice.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for light cross platform Threading library
    By umen242 in forum C++ Programming
    Replies: 7
    Last Post: 03-28-2008, 04:23 PM
  2. Cross platform XML library
    By Josh Kasten in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2007, 04:04 PM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. cross platform game programming
    By xddxogm3 in forum Game Programming
    Replies: 13
    Last Post: 08-22-2004, 09:40 AM