1.2.1.2.98 TCPIP_BSD_PresSocket Function

C

int TCPIP_BSD_PresSocket(
    SOCKET s
);

Description

The function returns the NET_PRES socket number associated with the BSD socket. Using this call, the caller can access the NET_PRES API.

Preconditions

The socket() function should have been called.

Parameters

ParametersDescription
sSocket descriptor returned from a previous call to socket().

Returns

  • >= 0 - If function is successful. Value refers to socket number.

  • -1 - No such socket exists and errno is set to EBADF.

Remarks

This function works for both TCP and UDP sockets.

The NET_PRES UDP sockets are created after a call to bind() (server sockets) or connect() (client sockets). The NET_PRES TCP sockets are created after a call to listen() (server sockets) or connect() (client sockets). Calling the TCPIP_BSD_PresSocket before the sockets are created will return an INVALID_SOCKET.

The BSD module uses the NET_PRES layer for supporting encrypted connections. This function returns the NET_PRES socket used for the connection.