![]() |
SCTC
the soundcloud.com terminal client
|
Data Structures | |
| struct | plain_conn |
Macros | |
| #define | PLAIN_CONN_MAGIC 0x35363738 |
Functions | |
| bool | plain_send (struct network_conn *nwc, char *buffer, size_t buffer_len) |
| bool | plain_send_fmt (struct network_conn *nwc, char *fmt,...) |
| int | plain_recv (struct network_conn *nwc, char *buffer, size_t buffer_len) |
| Receive a data from a connected plain TCP/IP socket. More... | |
| int | plain_recv_byte (struct network_conn *nwc) |
| Receive a single byte from a connected plain TCP/IP socket. More... | |
| void | plain_disconnect (struct network_conn *nwc) |
| Disconnect a connected plain TCP/IP socket. More... | |
| struct network_conn * | plain_connect (char *server, int port) |
| Connect a plain TCP/IP socket to server:port. More... | |
| #define PLAIN_CONN_MAGIC 0x35363738 |
| struct network_conn* plain_connect | ( | char * | server, |
| int | port | ||
| ) |
Connect a plain TCP/IP socket to server:port.
| server | The server to connect to, either an IP or a hostname. |
| port | The servers port ( ) |
| void plain_disconnect | ( | struct network_conn * | nwc | ) |
Disconnect a connected plain TCP/IP socket.
After a call to plain_disconnect() all the memory assocatied to nwc is free'd, nwc may not be used anymore.
| nwc | The connection to disconnect |
| int plain_recv | ( | struct network_conn * | nwc, |
| char * | buffer, | ||
| size_t | buffer_len | ||
| ) |
Receive a data from a connected plain TCP/IP socket.
TODO
| nwc | The connection to read from |
| buffer | The buffer receiving the read data |
| buffer_len | The size of the buffer |
| int plain_recv_byte | ( | struct network_conn * | nwc | ) |
Receive a single byte from a connected plain TCP/IP socket.
As soon as -1 is returned the underlying TCP/IP connection has been disconnected (for instance by the remote server). Any further call to plain_recv* will fail, so just call plain_disconnect() to free the data. "The horse is dead"
| nwc | The connection to read from |
| bool plain_send | ( | struct network_conn * | nwc, |
| char * | buffer, | ||
| size_t | buffer_len | ||
| ) |
| bool plain_send_fmt | ( | struct network_conn * | nwc, |
| char * | fmt, | ||
| ... | |||
| ) |
1.8.9.1