WSASocket vs socket

This is a discussion on WSASocket vs socket within the Networking/Device Communication forums, part of the General Programming Boards category; If we opened Code: SOCKET sock = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, 0, 0, 0); on one side, can we connect to ...

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

    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?
    Compiler MSVC++ 2013 with Code::Blocks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,769
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    812
    Thanks Salem!
    Compiler MSVC++ 2013 with Code::Blocks.

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, 12:45 PM
  2. Problem with socket descriptors
    By McKracken in forum C Programming
    Replies: 1
    Last Post: 07-22-2009, 09:51 AM
  3. socket programming question, closing sockets...
    By ursula in forum Networking/Device Communication
    Replies: 2
    Last Post: 05-31-2009, 06: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, 12:48 PM

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