RetroArch
Functions
netplay_buf.c File Reference
#include <stdlib.h>
#include <net/net_compat.h>
#include <net/net_socket.h>
#include "netplay_private.h"
Include dependency graph for netplay_buf.c:

Functions

static size_t buf_used (struct socket_buffer *sbuf)
 
static size_t buf_unread (struct socket_buffer *sbuf)
 
static size_t buf_remaining (struct socket_buffer *sbuf)
 
bool netplay_init_socket_buffer (struct socket_buffer *sbuf, size_t size)
 
bool netplay_resize_socket_buffer (struct socket_buffer *sbuf, size_t newsize)
 
void netplay_deinit_socket_buffer (struct socket_buffer *sbuf)
 
void netplay_clear_socket_buffer (struct socket_buffer *sbuf)
 
bool netplay_send (struct socket_buffer *sbuf, int sockfd, const void *buf, size_t len)
 
bool netplay_send_flush (struct socket_buffer *sbuf, int sockfd, bool block)
 
ssize_t netplay_recv (struct socket_buffer *sbuf, int sockfd, void *buf, size_t len, bool block)
 
void netplay_recv_reset (struct socket_buffer *sbuf)
 
void netplay_recv_flush (struct socket_buffer *sbuf)
 

Function Documentation

◆ buf_remaining()

static size_t buf_remaining ( struct socket_buffer sbuf)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buf_unread()

static size_t buf_unread ( struct socket_buffer sbuf)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buf_used()

static size_t buf_used ( struct socket_buffer sbuf)
static
Here is the caller graph for this function:

◆ netplay_clear_socket_buffer()

void netplay_clear_socket_buffer ( struct socket_buffer sbuf)

◆ netplay_deinit_socket_buffer()

void netplay_deinit_socket_buffer ( struct socket_buffer sbuf)

netplay_deinit_socket_buffer

Free a socket buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_init_socket_buffer()

bool netplay_init_socket_buffer ( struct socket_buffer sbuf,
size_t  size 
)

netplay_init_socket_buffer

Initialize a new socket buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_recv()

ssize_t netplay_recv ( struct socket_buffer sbuf,
int  sockfd,
void buf,
size_t  len,
bool  block 
)

netplay_recv

Receive buffered or fresh data.

Returns number of bytes returned, which may be short or 0, or -1 on error.

Here is the call graph for this function:

◆ netplay_recv_flush()

void netplay_recv_flush ( struct socket_buffer sbuf)

netplay_recv_flush

Flush our recv buffer, so a future netplay_recv_reset will reset to this point.

Here is the caller graph for this function:

◆ netplay_recv_reset()

void netplay_recv_reset ( struct socket_buffer sbuf)

netplay_recv_reset

Reset our recv buffer so that future netplay_recvs will read the same data again.

Here is the caller graph for this function:

◆ netplay_resize_socket_buffer()

bool netplay_resize_socket_buffer ( struct socket_buffer sbuf,
size_t  newsize 
)

netplay_resize_socket_buffer

Resize the given socket_buffer's buffer to the requested size.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_send()

bool netplay_send ( struct socket_buffer sbuf,
int  sockfd,
const void buf,
size_t  len 
)

netplay_send

Queue the given data for sending.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_send_flush()

bool netplay_send_flush ( struct socket_buffer sbuf,
int  sockfd,
bool  block 
)

netplay_send_flush

Flush unsent data in the given socket buffer, blocking to do so if requested.

Returns false only on socket failures, true otherwise.

Here is the call graph for this function:
Here is the caller graph for this function: