#include "fdbuf.h"
Go to the source code of this file.
Classes | |
| struct | tcp_conn |
Typedefs | |
| typedef tcp_conn | TCPC |
| typedef TCPC | Connection |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT TCPC * | tcp_open (in_addr_t host, in_port_t port, int block) |
| LIBGIFT_EXPORT TCPC * | tcp_accept (TCPC *listening, int block) |
| LIBGIFT_EXPORT TCPC * | tcp_bind (in_port_t port, int block) |
| LIBGIFT_EXPORT void | tcp_close (TCPC *c) |
| LIBGIFT_EXPORT void | tcp_close_null (TCPC **c) |
| LIBGIFT_EXPORT int | tcp_flush (TCPC *c, int write) |
| LIBGIFT_EXPORT int | tcp_write (TCPC *c, unsigned char *data, size_t len) |
| LIBGIFT_EXPORT int | tcp_writestr (TCPC *c, char *data) |
| LIBGIFT_EXPORT int | tcp_send (TCPC *c, unsigned char *data, size_t len) |
| LIBGIFT_EXPORT FDBuf * | tcp_readbuf (TCPC *c) |
| LIBGIFT_EXPORT int | tcp_recv (TCPC *c, unsigned char *buf, size_t len) |
| LIBGIFT_EXPORT int | tcp_peek (TCPC *c, unsigned char *buf, size_t len) |
This structure is passed along to pretty much every internal giFT function to encompass all the network functionality that will be required. Also the recommended method of interfacing with the event loop.
|
|
Backwards compatibility |
|
|
Basic building block for all connections spawned using libgiFT. If you wish to use libgiFT at all, use these. |
|
||||||||||||
|
Accepts an incoming socket connection.
|
|
||||||||||||
|
Binds to the supplied port.
|
|
|
Close (and free) a connection pointer.
|
|
|
Wrapper for tcp_close that sets the calling argument to NULL afterwards.
|
|
||||||||||||
|
Flush and destroy the pending write queue.
|
|
||||||||||||||||
|
Creates a new connection structure and attempts an outgoing TCP connection using net_connect.
|
|
||||||||||||||||
|
Identical to tcp_recv, except that recv is given the MSG_PEEK option. |
|
|
Accessor for the buffer object. |
|
||||||||||||||||
|
Direct recv wrapper to maintain a consistent interface. |
|
||||||||||||||||
|
Direct send wrapper to maintain a consistent interface. |
|
||||||||||||||||
|
Abstracted send call implemented with a user-space socket write queue to avoid flooding the kernel. |
|
||||||||||||
|
Simple wrapper for tcp_write for NUL-terminated strings. |
1.3.7