Thread: sockets

  1. #1
    Registered User
    Join Date
    Nov 2005


    i understand the basic sock functions and how to use them, like socket(), bind(), listen(), connect(), accept(), send(), & recv(). i'm having some trouble figuring out how to use sockets though. i'm not really understanding what the structs sockaddr_in and sockaddr do. i know that they store the address and the port, but i don't really know what else and for what.

    can anyone tell me what sockaddr_in and sockaddr are for, what they do, and what the difference between them is? thank you for your time.

  2. #2
    Registered User
    Join Date
    Sep 2001
    As far as I know, storing that kind of data really is all they do. All the real work goes on behind the scenes at the operating system level. MSDN and Beej's could clarify more specifics for you.

    sockaddr_in is just a version of sockaddr specialized for use on the internet.

    Moved to the Networking Board.

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Beej Guide To Network Programming...
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe - Developing free software for the community.

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