RetroArch
Macros | Functions
netplay_io.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <boolean.h>
#include <compat/strl.h>
#include "netplay_private.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../tasks/tasks_internal.h"
Include dependency graph for netplay_io.c:

Macros

#define BUFSZ   16 /* FIXME: Arbitrary restriction */
 
#define RECV(buf, sz)
 
#define START(which)
 
#define NEXT()
 

Functions

static void handle_play_spectate (netplay_t *netplay, uint32_t client_num, struct netplay_connection *connection, uint32_t cmd, uint32_t cmd_size, uint32_t *payload)
 
static void remote_unpaused (netplay_t *netplay, struct netplay_connection *connection)
 
void netplay_hangup (netplay_t *netplay, struct netplay_connection *connection)
 
void netplay_delayed_state_change (netplay_t *netplay)
 
static bool send_input_frame (netplay_t *netplay, struct delta_frame *dframe, struct netplay_connection *only, struct netplay_connection *except, uint32_t client_num, bool slave)
 
bool netplay_send_cur_input (netplay_t *netplay, struct netplay_connection *connection)
 
bool netplay_send_raw_cmd (netplay_t *netplay, struct netplay_connection *connection, uint32_t cmd, const void *data, size_t size)
 
void netplay_send_raw_cmd_all (netplay_t *netplay, struct netplay_connection *except, uint32_t cmd, const void *data, size_t size)
 
static void netplay_send_flush_all (netplay_t *netplay, struct netplay_connection *except)
 
static bool netplay_cmd_nak (netplay_t *netplay, struct netplay_connection *connection)
 
bool netplay_cmd_crc (netplay_t *netplay, struct delta_frame *delta)
 
bool netplay_cmd_request_savestate (netplay_t *netplay)
 
bool netplay_cmd_mode (netplay_t *netplay, enum rarch_netplay_connection_mode mode)
 
bool netplay_cmd_stall (netplay_t *netplay, struct netplay_connection *connection, uint32_t frames)
 
static void announce_play_spectate (netplay_t *netplay, const char *nick, enum rarch_netplay_connection_mode mode, uint32_t devices)
 
static bool netplay_get_cmd (netplay_t *netplay, struct netplay_connection *connection, bool *had_input)
 
int netplay_poll_net_input (netplay_t *netplay, bool block)
 
void netplay_handle_slaves (netplay_t *netplay)
 
void netplay_announce_nat_traversal (netplay_t *netplay)
 
void netplay_init_nat_traversal (netplay_t *netplay)
 

Macro Definition Documentation

◆ BUFSZ

#define BUFSZ   16 /* FIXME: Arbitrary restriction */

◆ NEXT

#define NEXT ( )
Value:
do { \
ptr = NEXT_PTR(ptr); \
dframe = &netplay->buffer[ptr]; \
} while(0)
#define NEXT_PTR(x)
Definition: netplay_private.h:61
const GLvoid * ptr
Definition: nx_glsym.h:242
Definition: netplay_private.h:383
struct delta_frame * buffer
Definition: netplay_private.h:451

◆ RECV

#define RECV (   buf,
  sz 
)
Value:
recvd = netplay_recv(&connection->recv_packet_buffer, connection->fd, (buf), \
(sz), false); \
if (recvd >= 0 && recvd < (ssize_t) (sz)) goto shrt; \
else if (recvd < 0)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
ssize_t netplay_recv(struct socket_buffer *sbuf, int sockfd, void *buf, size_t len, bool block)
Definition: netplay_buf.c:245

◆ START

#define START (   which)
Value:
do { \
ptr = which; \
dframe = &netplay->buffer[ptr]; \
} while(0)
const GLvoid * ptr
Definition: nx_glsym.h:242
Definition: netplay_private.h:383
struct delta_frame * buffer
Definition: netplay_private.h:451

Function Documentation

◆ announce_play_spectate()

static void announce_play_spectate ( netplay_t netplay,
const char *  nick,
enum rarch_netplay_connection_mode  mode,
uint32_t  devices 
)
static

announce_play_spectate

Announce a play or spectate mode change

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

◆ handle_play_spectate()

static void handle_play_spectate ( netplay_t netplay,
uint32_t  client_num,
struct netplay_connection connection,
uint32_t  cmd,
uint32_t  cmd_size,
uint32_t in_payload 
)
static

handle_play_spectate

Handle a play or spectate request

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

◆ netplay_announce_nat_traversal()

void netplay_announce_nat_traversal ( netplay_t netplay)

netplay_announce_nat_traversal

Announce successful NAT traversal.

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

◆ netplay_cmd_crc()

bool netplay_cmd_crc ( netplay_t netplay,
struct delta_frame delta 
)

netplay_cmd_crc

Send a CRC command to all active clients.

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

◆ netplay_cmd_mode()

bool netplay_cmd_mode ( netplay_t netplay,
enum rarch_netplay_connection_mode  mode 
)

netplay_cmd_mode

Send a mode change request. As a server, the request is to ourself, and so honored instantly.

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

◆ netplay_cmd_nak()

static bool netplay_cmd_nak ( netplay_t netplay,
struct netplay_connection connection 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_cmd_request_savestate()

bool netplay_cmd_request_savestate ( netplay_t netplay)

netplay_cmd_request_savestate

Send a savestate request command.

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

◆ netplay_cmd_stall()

bool netplay_cmd_stall ( netplay_t netplay,
struct netplay_connection connection,
uint32_t  frames 
)

netplay_cmd_stall

Send a stall command.

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

◆ netplay_delayed_state_change()

void netplay_delayed_state_change ( netplay_t netplay)

netplay_delayed_state_change:

Handle any pending state changes which are ready as of the beginning of the current frame.

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

◆ netplay_get_cmd()

static bool netplay_get_cmd ( netplay_t netplay,
struct netplay_connection connection,
bool had_input 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_handle_slaves()

void netplay_handle_slaves ( netplay_t netplay)

netplay_handle_slaves

Handle any slave connections

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

◆ netplay_hangup()

void netplay_hangup ( netplay_t netplay,
struct netplay_connection connection 
)

netplay_hangup:

Disconnects an active Netplay connection due to an error

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

◆ netplay_init_nat_traversal()

void netplay_init_nat_traversal ( netplay_t netplay)

netplay_init_nat_traversal

Initialize the NAT traversal library and try to open a port

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

◆ netplay_poll_net_input()

int netplay_poll_net_input ( netplay_t netplay,
bool  block 
)

netplay_poll_net_input

Poll input from the network

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

◆ netplay_send_cur_input()

bool netplay_send_cur_input ( netplay_t netplay,
struct netplay_connection connection 
)

netplay_send_cur_input

Send the current input frame to a given connection.

Returns true if successful, false otherwise.

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

◆ netplay_send_flush_all()

static void netplay_send_flush_all ( netplay_t netplay,
struct netplay_connection except 
)
static

netplay_send_flush_all

Flush all of our output buffers

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

◆ netplay_send_raw_cmd()

bool netplay_send_raw_cmd ( netplay_t netplay,
struct netplay_connection connection,
uint32_t  cmd,
const void data,
size_t  size 
)

netplay_send_raw_cmd

Send a raw Netplay command to the given connection.

Returns true on success, false on failure.

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

◆ netplay_send_raw_cmd_all()

void netplay_send_raw_cmd_all ( netplay_t netplay,
struct netplay_connection except,
uint32_t  cmd,
const void data,
size_t  size 
)

netplay_send_raw_cmd_all

Send a raw Netplay command to all connections, optionally excluding one (typically the client that the relevant command came from)

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

◆ remote_unpaused()

static void remote_unpaused ( netplay_t netplay,
struct netplay_connection connection 
)
static

remote_unpaused

Mark a particular remote connection as unpaused and, if relevant, inform every one else that they may resume.

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

◆ send_input_frame()

static bool send_input_frame ( netplay_t netplay,
struct delta_frame dframe,
struct netplay_connection only,
struct netplay_connection except,
uint32_t  client_num,
bool  slave 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: