Function

sock_socket

Declaration

errno_t sock_socket(int domain, int type, int protocol, sock_upcall callback, void *cookie, socket_t *new_so);

Parameters

domain

The socket domain (PF_INET, etc...).

type

The socket type (SOCK_STREAM, SOCK_DGRAM, etc...).

protocol

The socket protocol.

callback

A notifier function to be called when an event occurs on the socket. This may be NULL.

cookie

A cookie passed directly to the callback.

new_so

Upon success, a reference to the new socket.

Return Value

0 on success otherwise the errno error.

Discussion

Allocate a socket. Allocating a socket in this manner creates a socket with no associated file descriptor. For more information, see 'man 2 socket'.

See Also

Miscellaneous

sock_accept

Deprecated
sock_bind

Deprecated
sock_close

Deprecated
sock_connect

Deprecated
sock_getsockopt

Deprecated
sock_gettype

Deprecated
sock_ioctl

Deprecated
sock_listen

Deprecated
sock_receive

Deprecated
sock_send

Deprecated
sock_sendmbuf

Deprecated
sock_setpriv

Deprecated
sock_setsockopt

Deprecated
sock_shutdown

Deprecated