PatchworkOS
Loading...
Searching...
No Matches
Local Connections

Local Connections. More...

Data Structures

struct  local_conn_t
 Local Connection structure. More...
 

Functions

local_conn_tlocal_conn_new (local_listen_t *listen)
 Allocate and initialize a new local connection.
 
void local_conn_free (local_conn_t *conn)
 Free and deinitialize a local connection.
 

Detailed Description

Local Connections.

Local connections represents a "link" between a listener and a client socket. They provide two-way communication channels using ring buffers.

Function Documentation

◆ local_conn_free()

void local_conn_free ( local_conn_t conn)

Free and deinitialize a local connection.

Parameters
connPointer to the local connection to free.

Definition at line 54 of file local_conn.c.

References local_conn_t::clientToServerBuffer, DEREF, EINVAL, errno, free(), local_conn_t::listen, NULL, and local_conn_t::serverToClientBuffer.

Referenced by local_conn_new().

◆ local_conn_new()

local_conn_t * local_conn_new ( local_listen_t listen)

Allocate and initialize a new local connection.

Parameters
listenPointer to the local listener this connection is associated with.
Returns
On success, a pointer to the new local connection. On failure, NULL and errno is set.

Definition at line 14 of file local_conn.c.

References local_conn_t::clientToServer, local_conn_t::clientToServerBuffer, EINVAL, local_conn_t::entry, errno, free(), local_conn_t::isClosed, list_entry_init(), local_conn_t::listen, LOCAL_BUFFER_SIZE, local_conn_free(), local_conn_t::lock, lock_init(), malloc(), NULL, local_conn_t::ref, REF, ref_init(), ring_init(), local_conn_t::serverToClient, local_conn_t::serverToClientBuffer, wait_queue_init(), and local_conn_t::waitQueue.

Referenced by local_socket_connect().