Network Programming

This is a discussion on Network Programming within the C++ Programming forums, part of the General Programming Boards category; Ok, I don't even know if thats what its called... but I want to learn how to program things to ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    35

    Network Programming

    Ok, I don't even know if thats what its called... but I want to learn how to program things to work over the internet and local networks... Obviously, I'm very new to that (Although I know C++ somewhat now...) Does anyone know where I could learn this kind of thing?

  2. #2
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    Search Google or the cprogramming.com directory for something called Winsock.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    35
    Is there any way to do it without using winsock?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,851
    > Is there any way to do it without using winsock?
    Use linux as your operating system

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    35
    Ok... What IS Winsock? From looking at the stuff at MSDN it's a "Windows Socket"... that helped me not.

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    If you do a search this info will be easy to find.

    From a little while ago

  7. #7
    Unregistered
    Guest
    http://code.box.sk/box.php3?noup=yes...txt=Networking


    your answer is here.
    read beej's guide thats how I learned sockets.

    I beleive sockets are easier in linux than windows as there is no intialising winsock, however if youve got to use windows then read the winsock FAQ it tells you all you need to know and more.

  8. #8
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    it depends what type of network programing you want to do - if you want to client/server stuff or internet updates and things like that - you need to use winsock, probablly you will need to learn a little tcp/ip aswell.

    For lan programming you can use the same (for ethernet) however for serial / parallel networks i dont think you can use winsock, im trying to write some parallel networking software - and im trying to come up with my own protocols to control it
    Monday - what a way to spend a seventh of your life

  9. #9
    Unregistered
    Guest
    Originally posted by vVv
    Actually, it's almost the same. Both, Windows and *x have the same API functions. On Win, you just have to paste this snippet at the beginning of your code:

    Code:
        /* initialize windows sockets */
    {
    WSADATA wsa;
    if (WSAStartup(MAKEWORD(1, 1), &wsa))
    {
    printf("WSAStartup() failed, %lu\n", (unsigned long)GetLastError());
    return EXIT_FAILURE;
    }
    }
    ...use the datatype SOCKET instead of int for creating a socket. And Windows knows closesocket() instead of close() (from unistd.h)... These are all the differences i can think of atm... Just use #ifdef's for these parts.

    not quite!

    the one major difference which I dont like is that *nix allows you to cycle through stdin as part of a descriptor set when using select and windows doesnt. its easy to get round but its my preffered way of coding servers.

  10. #10
    Señor Member
    Join Date
    Jan 2002
    Posts
    561
    Couldn't you also use DirectPlay from DirectX?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wireless Network Linux & C Testbed
    By james457 in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-11-2009, 12:03 PM
  2. 3D Network Analysis Tool
    By durban in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 11-08-2005, 06:33 PM
  3. Need help with easy Network setup
    By the dead tree in forum Tech Board
    Replies: 9
    Last Post: 04-08-2005, 08:44 PM
  4. network problems
    By lucy in forum Tech Board
    Replies: 6
    Last Post: 01-01-2003, 03:33 PM
  5. WinXP Network Connections pop-up
    By DavidP in forum Tech Board
    Replies: 1
    Last Post: 10-02-2002, 06:36 PM

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