Thread: sockets in c

  1. #1
    life is a nightmare
    Join Date
    Apr 2007
    Posts
    127

    sockets in c

    hi all
    i am not asking for a code this time or any thing you will not have to deal with my bad indentation this time
    any way i am trying to learn sockets in c
    where to start and what to learn
    maybe tcp/ip or any thing else "i know learn every thing" but what to focus on ?
    and i am dealing with windows and linux ;
    i just need your advices not books not links nothing just your advices
    thanks all

  2. #2
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    I'd suggest the TCP protocol, which Beej describes in his tutorial, for simple data transfer between two or more computers on a LAN; UDP (which Beej also describes) for data transfer over the internet, or for high-speed data transfer over a LAN.

    You could either use the BSD socket routines, (i.e. Winsock on Windows) or the SDL_Net library. I'd recommend the SDL_Net library if you're doing some kind of game programming, mainly because it requires the SDL to begin. Note that you _can_ use SDL_Net without using the SDL graphics library.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    UDP for data transfer over the internet
    ???

    You use UDP when you mostly have one-way communication and when you don't care if a package doesn't arrive, or after one that was sent later. You use TCP when you need a reliable connection.

    I'd recommend the SDL_Net library if you're doing some kind of game programming, mainly because it requires the SDL to begin.
    Games don't require SDL. You can use it, but you don't need it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    life is a nightmare
    Join Date
    Apr 2007
    Posts
    127
    You use TCP when you need a reliable connection.
    I'd suggest the TCP protocol, which Beej describes in his tutorial
    ok so you recommended the tcp protocol
    ok any thing else

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Security. Once you do socket programming, you're exposing your programs to the evil that is out there. Learn what causes security holes and learn how to avoid them.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    life is a nightmare
    Join Date
    Apr 2007
    Posts
    127
    Quote Originally Posted by CornedBee View Post
    Security. Once you do socket programming, you're exposing your programs to the evil that is out there. Learn what causes security holes and learn how to avoid them.
    thanks for that i i am already planning for that
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to poll sockets?
    By 39ster in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-22-2008, 01:43 PM
  2. Cross platform sockets
    By zacs7 in forum Networking/Device Communication
    Replies: 5
    Last Post: 06-27-2007, 05:16 AM
  3. multiple UDP sockets with select()
    By nkhambal in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-17-2006, 07:36 PM
  4. Raw Sockets and SP2...
    By Devil Panther in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-12-2005, 04:52 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 11:49 AM