TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   create socket on view (http://forums.techarena.in/software-development/1116890.htm)

Jamaima 05-02-2009 07:30 PM

create socket on view
 
I would ask some advice on how to create socket on vista using visual studio, I have already created some client & socket but on linux with gcc and running, but if I try to compile it on platform with microsoft visual studio I will not be completed because some libraries are not recognized.

Can you guide me?

Adley 05-02-2009 11:11 PM

Re: create socket on view
 
include winsock2.he linka ws2_32.lib. Windows in general is highly compatible with the Berkeley sockets (not quite know, but in 95% of cases you'll never to do with the differences).

Khushal 05-02-2009 11:14 PM

Re: create socket on view
 
The socket function creates a socket that is bound to a specific transport service provider.

Syntax

Code:

WSAAPI SOCKET socket (
    __in int af,
    __in int type,
    __in int protocol
 );

The address family specification. Possible values for the address family are defined in the header file Winsock2.h.

On the Windows SDK released for Windows Vista and later, the organization of header files has changed and the possible values for the address family are defined in the header file Ws2def.h. Ws2def.h Note that the header file is automatically included in Winsock2.h, and should never be used directly.

The values currently supported are AF_INET or AF_INET6, which are the Internet address family formats for IPv4 and IPv6. Other options for address family (AF_NETBIOS for use with NetBIOS, for example) are supported if a Windows Sockets service provider for the address family is installed. Note that the values for the AF_ address PF_ family and protocol family constants are identical (for example, AF_INET and PF_INET), so either constant can be used.

for table values you can have a look at it:
http://209.85.143.101/translate_c?hl...uYBOiou1uFf60g


All times are GMT +5.5. The time now is 11:47 AM.