Socket programming - Question

This is a discussion on Socket programming - Question within the C Programming forums, part of the General Programming Boards category; Hi, I want to start learning socket programming, I've talked to some programmers and they told me socket programming under ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    1

    Socket programming - Question

    Hi,

    I want to start learning socket programming, I've talked to some programmers and they told me socket programming under linux is much easier and its not worth it to do network programming under windows, I'm just wondering, Should I learn winsock programming? or just install linux and learn how to use sockets under linux?

    Thanks in advance.

    Btw, I'm using Borland C/C++ compiler, And i code in C.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    Socket programming on Linux has the same degree of difficulty as programming on windows. Just do a google search on "winsock tutorial" to learn how to use it.

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    5
    http://beej.us/guide/bgnet/

    For socket programming on Linux. It mentions the differences of Winsock too.

  4. #4
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Quote Originally Posted by bithub
    Socket programming on Linux has the same degree of difficulty as programming on windows. Just do a google search on "winsock tutorial" to learn how to use it.
    Until you try to make the two work together, and all the little differences hit you in the face like a brick wall. (Mustn't... rant...) I've tried to code for both OSs, but the #ifdefs get agonizing after a while. (Now I have a basic wrapper to eliminate such crazyness.)

    Otherwise, they are similar, at best. It's good to learn the differences early. Linux I like, but Windows is what is used. Pick your poison.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  5. #5
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    I would suggsest you learn on linux, you'll probably find it easier, you'll still learn all the concepts you need, you get to use symbolic links and a sane file structure and makefiles, and you can always go back to windows and see the differences.

  6. #6
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    Until you try to make the two work together, and all the little differences hit you in the face like a brick wall.
    I didn't say they were the same, I said they were the same degree of difficulty.

    The only real difference between the two is the error codes, and the calls the WSAStartup() and WSAShutdown(). It is very easy to write socket code which is compatible across platforms.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Socket Question
    By BENCHMARKMAN in forum C Programming
    Replies: 15
    Last Post: 03-12-2008, 09:57 PM
  2. Socket program
    By mhetfield in forum C Programming
    Replies: 5
    Last Post: 04-03-2007, 03:46 PM
  3. Slight problem with socket reading!!!
    By bobthebullet990 in forum C Programming
    Replies: 5
    Last Post: 02-15-2006, 08:55 AM
  4. problem closing socket
    By Wisefool in forum Networking/Device Communication
    Replies: 2
    Last Post: 10-29-2003, 11:19 AM
  5. Simple Socket Question
    By SourceCode in forum Linux Programming
    Replies: 2
    Last Post: 06-22-2003, 09:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21