RetroArch
|
#include <stdlib.h>
#include <net/net_compat.h>
#include <net/net_socket.h>
#include "netplay_private.h"
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) |
|
static |
|
static |
|
static |
void netplay_clear_socket_buffer | ( | struct socket_buffer * | sbuf | ) |
void netplay_deinit_socket_buffer | ( | struct socket_buffer * | sbuf | ) |
netplay_deinit_socket_buffer
Free a socket buffer.
bool netplay_init_socket_buffer | ( | struct socket_buffer * | sbuf, |
size_t | size | ||
) |
netplay_init_socket_buffer
Initialize a new socket buffer.
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.
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.
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.
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.
bool netplay_send | ( | struct socket_buffer * | sbuf, |
int | sockfd, | ||
const void * | buf, | ||
size_t | len | ||
) |
netplay_send
Queue the given data for sending.
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.