VLC 4.0.0-dev
Loading...
Searching...
No Matches

Transport-layer stream abstraction. More...

Include dependency graph for stream.c:

Data Structures

struct  vlc_tls_socket
 

Macros

#define SOL_TCP   IPPROTO_TCP
 

Typedefs

typedef struct vlc_tls_socket vlc_tls_socket_t
 

Functions

ssize_t vlc_tls_Read (vlc_tls_t *session, void *buf, size_t len, bool waitall)
 Receives data through a socket.
 
ssize_t vlc_tls_Write (vlc_tls_t *session, const void *buf, size_t len)
 Sends data through a socket.
 
char * vlc_tls_GetLine (vlc_tls_t *session)
 Receives a text line through a socket.
 
static int vlc_tls_SocketGetFD (vlc_tls_t *tls, short *restrict events)
 
static ssize_t vlc_tls_SocketRead (vlc_tls_t *tls, struct iovec *iov, unsigned count)
 
static ssize_t vlc_tls_SocketWrite (vlc_tls_t *tls, const struct iovec *iov, unsigned count)
 
static int vlc_tls_SocketShutdown (vlc_tls_t *tls, bool duplex)
 
static void vlc_tls_SocketClose (vlc_tls_t *tls)
 
static vlc_tls_tvlc_tls_SocketAlloc (int fd, const struct sockaddr *restrict peer, socklen_t peerlen)
 
vlc_tls_tvlc_tls_SocketOpen (int fd)
 Creates a transport-layer stream from a socket.
 
int vlc_tls_SocketPair (int family, int protocol, vlc_tls_t *pair[2])
 Creates a connected pair of transport-layer sockets.
 
static vlc_tls_tvlc_tls_SocketAddrInfo (const struct addrinfo *restrict info)
 Allocates an unconnected transport layer socket.
 
static int vlc_tls_WaitConnect (vlc_tls_t *tls)
 Waits for pending transport layer socket connection.
 
static ssize_t vlc_tls_Connect (vlc_tls_t *tls)
 Connects a transport layer socket.
 
static ssize_t vlc_tls_ConnectWrite (vlc_tls_t *tls, const struct iovec *iov, unsigned count)
 
vlc_tls_tvlc_tls_SocketOpenAddrInfo (const struct addrinfo *restrict info, bool defer_connect)
 
vlc_tls_tvlc_tls_SocketOpenTCP (vlc_object_t *obj, const char *name, unsigned port)
 Creates a transport-layer TCP stream from a name and port.
 

Variables

static const struct vlc_tls_operations vlc_tls_socket_ops
 
static const struct vlc_tls_operations vlc_tls_socket_fastopen_ops
 

Detailed Description

Transport-layer stream abstraction.

This file implements the transport-layer stream (vlc_tls) abstraction.

Macro Definition Documentation

◆ SOL_TCP

#define SOL_TCP   IPPROTO_TCP

Typedef Documentation

◆ vlc_tls_socket_t

Function Documentation

◆ vlc_tls_Connect()

static ssize_t vlc_tls_Connect ( vlc_tls_t tls)
static

◆ vlc_tls_ConnectWrite()

static ssize_t vlc_tls_ConnectWrite ( vlc_tls_t tls,
const struct iovec *  iov,
unsigned  count 
)
static

◆ vlc_tls_SocketAddrInfo()

static vlc_tls_t * vlc_tls_SocketAddrInfo ( const struct addrinfo *restrict  info)
static

Allocates an unconnected transport layer socket.

References net_Close, SOL_TCP, unlikely, vlc_socket(), and vlc_tls_SocketAlloc().

Referenced by vlc_tls_SocketOpenAddrInfo().

◆ vlc_tls_SocketAlloc()

static vlc_tls_t * vlc_tls_SocketAlloc ( int  fd,
const struct sockaddr *restrict  peer,
socklen_t  peerlen 
)
static

◆ vlc_tls_SocketClose()

static void vlc_tls_SocketClose ( vlc_tls_t tls)
static

◆ vlc_tls_SocketGetFD()

static int vlc_tls_SocketGetFD ( vlc_tls_t tls,
short *restrict  events 
)
static

◆ vlc_tls_SocketOpenAddrInfo()

vlc_tls_t * vlc_tls_SocketOpenAddrInfo ( const struct addrinfo *restrict  info,
bool  defer_connect 
)

◆ vlc_tls_SocketRead()

static ssize_t vlc_tls_SocketRead ( vlc_tls_t tls,
struct iovec *  iov,
unsigned  count 
)
static

◆ vlc_tls_SocketShutdown()

static int vlc_tls_SocketShutdown ( vlc_tls_t tls,
bool  duplex 
)
static

◆ vlc_tls_SocketWrite()

static ssize_t vlc_tls_SocketWrite ( vlc_tls_t tls,
const struct iovec *  iov,
unsigned  count 
)
static

◆ vlc_tls_WaitConnect()

static int vlc_tls_WaitConnect ( vlc_tls_t tls)
static

Waits for pending transport layer socket connection.

References pollfd::events, pollfd::fd, POLLOUT, vlc_killed(), vlc_poll_i11e(), and vlc_tls_GetFD().

Referenced by vlc_tls_Connect(), and vlc_tls_ConnectWrite().

Variable Documentation

◆ vlc_tls_socket_fastopen_ops

const struct vlc_tls_operations vlc_tls_socket_fastopen_ops
static
Initial value:
=
{
}
static void vlc_tls_SocketClose(vlc_tls_t *tls)
Definition stream.c:215
static int vlc_tls_SocketGetFD(vlc_tls_t *tls, short *restrict events)
Definition stream.c:174
static int vlc_tls_SocketShutdown(vlc_tls_t *tls, bool duplex)
Definition stream.c:208
static ssize_t vlc_tls_ConnectWrite(vlc_tls_t *tls, const struct iovec *iov, unsigned count)
Definition stream.c:359
static ssize_t vlc_tls_SocketRead(vlc_tls_t *tls, struct iovec *iov, unsigned count)
Definition stream.c:182

Referenced by vlc_tls_SocketOpenAddrInfo().

◆ vlc_tls_socket_ops

const struct vlc_tls_operations vlc_tls_socket_ops
static
Initial value:
=
{
}
static ssize_t vlc_tls_SocketWrite(vlc_tls_t *tls, const struct iovec *iov, unsigned count)
Definition stream.c:195

Referenced by vlc_tls_ConnectWrite(), and vlc_tls_SocketAlloc().