Thread: WSASocket vs socket

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    932

    WSASocket vs socket

    If we opened
    Code:
    SOCKET sock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 0, 0);
    on one side, can we connect to it with

    Code:
    SOCKET sock = socket(AF_INET,SOCK_STREAM,0);
    on the client side or it must be same type on both side?
    Using Windows 10 with Code Blocks and MingW.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    It's just a different name for the same functionality.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Thanks Salem!
    Using Windows 10 with Code Blocks and MingW.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function call from another .c module
    By Ali.B in forum C Programming
    Replies: 14
    Last Post: 08-03-2009, 11:45 AM
  2. Problem with socket descriptors
    By McKracken in forum C Programming
    Replies: 1
    Last Post: 07-22-2009, 08:51 AM
  3. socket programming question, closing sockets...
    By ursula in forum Networking/Device Communication
    Replies: 2
    Last Post: 05-31-2009, 05:17 PM
  4. when to close a socket
    By Wisefool in forum Networking/Device Communication
    Replies: 5
    Last Post: 11-02-2003, 10:33 AM
  5. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 11:48 AM