SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
int socket(int af, int type, int protocol);
DESCRIPTION
The
The NuTCRACKER Platform socket support is based on WinSock 2.0.
Connection-oriented sockets
such as SOCK_STREAM provide full-duplex connections, and
must be in a connected state before any data may be sent or
received on it. A connection to another socket is created with a
The communications protocols used to implement a reliable, connection-oriented socket, ensure that data is not lost or duplicated. If data for which the peer protocol has buffer space cannot be successfully transmitted within a reasonable length of time, the connection is considered broken and subsequent calls fail with the error code set to ETIMEDOUT.
Connectionless, message-oriented
sockets allow sending and receiving of datagrams to and from
arbitrary peers using
PARAMETERS
- af
-
Specifies the address family to be used with the socket. All the address families supported by WinSock 2.0 are supported in the NuTCRACKER Platform. Choices include AF_INET, AF_UNIX, AF_IPX, and so on. Platforms which have support for IPV6 installed may use AF_INET6 for the address family.
- type
-
Specifies the socket type which defines the semantics of communication.
- protocol
-
Specifies the appropriate protocol for the address family and socket type. It is indicated by a well known constant specific to each address family. The default protocol (protocol parameter to the
socket() call is 0) should be correct for most situations.
RETURN VALUES
If successful,
- EAFNOSUPPORT
-
The specified address family is not supported.
- EMFILE
-
No more socket descriptors can be created.
- ENETDOWN
-
The network subsystem has failed.
- ENOBUFS
-
No buffer space is available. The socket cannot be created.
- EPROTONOSUPPORT
-
The specified protocol is not supported.
- EPROTOTYPE
-
The socket type is not supported by the protocol.
- ESOCKTNOSUPPORT
-
The specified socket type is not supported in this address family.
CONFORMANCE
UNIX 98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
The NuTCRACKER Platform supports all the address families that WinSock 2.0 supports.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
accept() ,bind() ,connect() ,getsockname() ,getsockopt() ,listen() ,recv() ,select() ,send() ,shutdown() ,socketpair()
PTC MKS Toolkit 10.5 Documentation Build 40.