mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-25 12:00:36 +01:00
networking: declare connection transport APIs
This commit is contained in:
1 parent
f9ad12e6be
commit
2b5f10d580
3 files changed
+95
-1
No files matched your search
@@ -38,6 +38,8 @@ enum message_type
|
||||
|
||||
/* ---------- structures */
|
||||
|
||||
typedef word message_header;
|
||||
|
||||
/* ---------- prototypes/MESSAGE_HEADER.C */
|
||||
|
||||
void build_message_header(word *msg, word length, byte type, byte flags);
|
||||
|
||||
@@ -15,13 +15,76 @@ header included in hcex build.
|
||||
/* ---------- structures */
|
||||
|
||||
struct transport_endpoint;
|
||||
struct transport_endpoint_set;
|
||||
struct transport_address;
|
||||
|
||||
/* ---------- prototypes/TRANSPORT_ENDPOINT_WINSOCK.C */
|
||||
|
||||
struct transport_endpoint *create_transport_endpoint(
|
||||
long type);
|
||||
struct transport_endpoint_set *create_endpoint_set(
|
||||
long maximum_endpoints);
|
||||
long read_endpoint(
|
||||
struct transport_endpoint *endpoint,
|
||||
void *buffer,
|
||||
long size);
|
||||
long read_from_endpoint(
|
||||
struct transport_endpoint *endpoint,
|
||||
void *buffer,
|
||||
long size,
|
||||
struct transport_address *source_address);
|
||||
long write_endpoint(
|
||||
struct transport_endpoint *endpoint,
|
||||
void const *buffer,
|
||||
long size);
|
||||
boolean endpoint_readable(
|
||||
struct transport_endpoint *endpoint,
|
||||
long timeout);
|
||||
long endpoint_connected(
|
||||
struct transport_endpoint const *endpoint);
|
||||
short get_endpoint_address(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_address *address);
|
||||
short connect_endpoint(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_address const *address);
|
||||
short connect_endpoint_async(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_address const *address,
|
||||
void *process_reference);
|
||||
short set_endpoint_blocking(
|
||||
struct transport_endpoint *endpoint,
|
||||
boolean blocking);
|
||||
short bind_endpoint(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_address *address);
|
||||
short listen_endpoint(
|
||||
struct transport_endpoint *endpoint);
|
||||
struct transport_endpoint *accept_endpoint(
|
||||
struct transport_endpoint *listening_endpoint);
|
||||
short reject_endpoint(
|
||||
struct transport_endpoint *listening_endpoint);
|
||||
void disconnect_endpoint(
|
||||
struct transport_endpoint *endpoint);
|
||||
short poll_endpoint_set(
|
||||
struct transport_endpoint_set *set,
|
||||
long timeout);
|
||||
void rewind_endpoint_set(
|
||||
struct transport_endpoint_set *set);
|
||||
struct transport_endpoint *get_next_endpoint_from_set(
|
||||
struct transport_endpoint_set *set);
|
||||
long count_endpoints_in_set(
|
||||
struct transport_endpoint_set *set);
|
||||
short add_endpoint_to_set(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_endpoint_set *set);
|
||||
short remove_endpoint_from_set(
|
||||
struct transport_endpoint *endpoint,
|
||||
struct transport_endpoint_set *set);
|
||||
void delete_endpoint_set(
|
||||
struct transport_endpoint_set *set);
|
||||
void delete_transport_endpoint(
|
||||
struct transport_endpoint *endpoint);
|
||||
|
||||
/* ---------- globals */
|
||||
|
||||
|
||||
@@ -20,11 +20,37 @@ enum
|
||||
/* ---------- structures */
|
||||
|
||||
struct network_connection;
|
||||
struct transport_address;
|
||||
|
||||
/* ---------- prototypes/EXAMPLE.C */
|
||||
/* ---------- prototypes/NETWORK_CONNECTION.C */
|
||||
|
||||
void network_connection_initialize(
|
||||
void);
|
||||
long network_connection_connected(
|
||||
struct network_connection *connection);
|
||||
void network_connection_get_address(
|
||||
struct network_connection *connection,
|
||||
struct transport_address *reliable_address,
|
||||
struct transport_address *unreliable_address);
|
||||
boolean network_connection_connect(
|
||||
struct network_connection *connection,
|
||||
struct transport_address const *remote_address,
|
||||
void *process_reference);
|
||||
struct network_connection *network_connection_new(
|
||||
unsigned long flags,
|
||||
word well_known_port);
|
||||
boolean network_connection_read(
|
||||
struct network_connection *connection,
|
||||
void *buffer,
|
||||
word *buffer_size,
|
||||
struct transport_address *source_address);
|
||||
boolean network_connection_disconnect(
|
||||
struct network_connection *connection);
|
||||
boolean network_server_close_client_connection(
|
||||
struct network_connection *server_connection,
|
||||
struct network_connection *client_connection);
|
||||
void network_connection_delete(
|
||||
struct network_connection *connection);
|
||||
void network_connection_set_connection_rejection_procedure(
|
||||
struct network_connection *connection,
|
||||
void *connection_rejection_procedure);
|
||||
@@ -34,6 +60,9 @@ boolean network_connection_going_stale(
|
||||
struct network_connection *connection);
|
||||
void network_connection_keep_alive(
|
||||
struct network_connection *connection);
|
||||
boolean network_connection_server_accept_client_connection(
|
||||
struct network_connection *server_connection,
|
||||
struct network_connection *client_connection);
|
||||
void network_server_allow_client_connections(
|
||||
struct network_connection *server_connection,
|
||||
boolean allow_client_connections);
|
||||
|
||||
Reference in new issue
Block a user