DDraceNetwork Documentation
Loading...
Searching...
No Matches
UNIX Socket Networking
Collaboration diagram for UNIX Socket Networking:

Functions

UNIXSOCKET net_unix_create_unnamed ()
int net_unix_send (UNIXSOCKET sock, UNIXSOCKETADDR *addr, void *data, int size)
void net_unix_set_addr (UNIXSOCKETADDR *addr, const char *path)
void net_unix_close (UNIXSOCKET sock)

Detailed Description

Function Documentation

◆ net_unix_close()

void net_unix_close ( UNIXSOCKET sock)

Closes a Unix socket.

Parameters
sockSocket to close.

◆ net_unix_create_unnamed()

UNIXSOCKET net_unix_create_unnamed ( )

Creates an unnamed unix datagram socket.

Returns
On success it returns a handle to the socket. On failure it returns -1.

◆ net_unix_send()

int net_unix_send ( UNIXSOCKET sock,
UNIXSOCKETADDR * addr,
void * data,
int size )

Sends data to a Unix socket.

Parameters
sockSocket to use.
addrWhere to send the packet.
dataPointer to the packet data to send.
sizeSize of the packet.
Returns
Number of bytes sent. Negative value on failure.

◆ net_unix_set_addr()

void net_unix_set_addr ( UNIXSOCKETADDR * addr,
const char * path )

Sets the unixsocketaddress for a path to a socket file.

Parameters
addrPointer to the UNIXSOCKETADDR to fill.
pathPath to the (named) unix socket.