|
Atrinik Server 2.5
|
Go to the source code of this file.
Functions | |
| void | SockList_AddString (SockList *sl, const char *data) |
| char * | GetString_String (uint8 *data, int len, int *pos, char *dest, size_t dest_size) |
| int | SockList_ReadPacket (socket_struct *ns, int len) |
| int | SockList_ReadCommand (SockList *sl, SockList *sl2) |
| void | socket_enable_no_delay (int fd) |
| void | socket_disable_no_delay (int fd) |
| static void | socket_buffer_enqueue (socket_struct *ns, unsigned char *buf, size_t len, uint8 ndelay) |
| static void | socket_buffer_dequeue (socket_struct *ns) |
| void | socket_buffer_clear (socket_struct *ns) |
| void | socket_buffer_write (socket_struct *ns) |
| void | Send_With_Handling (socket_struct *ns, SockList *msg) |
| void | Write_String_To_Socket (socket_struct *ns, char cmd, const char *buf, int len) |
| void | write_cs_stats () |
Variables | |
| CS_Stats | cst_tot |
| CS_Stats | cst_lst |
Low level socket related functions.
Definition in file lowlevel.c.
| char* GetString_String | ( | uint8 * | data, |
| int | len, | ||
| int * | pos, | ||
| char * | dest, | ||
| size_t | dest_size | ||
| ) |
Construct a string from data packet.
| data | Data packet. | |
| len | Length of 'data'. | |
| [out] | pos | Position in the data packet. |
| dest | Will contain the string from data packet. | |
| dest_size | Size of 'dest'. |
Definition at line 59 of file lowlevel.c.
| void Send_With_Handling | ( | socket_struct * | ns, |
| SockList * | msg | ||
| ) |
Calls Write_To_Socket to send data to the client.
The only difference in this function is that we take a SockList, and we prepend the length information.
| ns | Socket to send the data to |
| msg | The SockList instance |
Definition at line 341 of file lowlevel.c.
| void socket_buffer_clear | ( | socket_struct * | ns | ) |
Dequeue all socket buffers in the queue.
| ns | Socket to clear the socket buffers for. |
Definition at line 257 of file lowlevel.c.
| static void socket_buffer_dequeue | ( | socket_struct * | ns | ) | [static] |
Dequeue data from the socket buffer queue.
| ns | Socket we're going to dequeue the socket buffer from. |
Definition at line 235 of file lowlevel.c.
| static void socket_buffer_enqueue | ( | socket_struct * | ns, |
| unsigned char * | buf, | ||
| size_t | len, | ||
| uint8 | ndelay | ||
| ) | [static] |
Enqueue data to the socket buffer queue.
| ns | The socket we are adding the data to. |
| buf | The data. |
| len | Number of bytes to add. |
| ndelay | If 1, will send this packet instantly without delay. |
Definition at line 207 of file lowlevel.c.
| void socket_buffer_write | ( | socket_struct * | ns | ) |
Write data to socket.
| ns | The socket we are writing to. |
Definition at line 268 of file lowlevel.c.
| void socket_disable_no_delay | ( | int | fd | ) |
Disable TCP_NODELAY on the specified file descriptor (socket).
| fd | Socket's file descriptor. |
Definition at line 191 of file lowlevel.c.
| void socket_enable_no_delay | ( | int | fd | ) |
Enable TCP_NODELAY on the specified file descriptor (socket).
| fd | Socket's file descriptor. |
Definition at line 178 of file lowlevel.c.
| void SockList_AddString | ( | SockList * | sl, |
| const char * | data | ||
| ) |
Add a NULL terminated string.
| sl | SockList instance to add to. |
| data | The string to add. |
Definition at line 37 of file lowlevel.c.
Read command from 'sl' and copy it to 'sl'.
| sl | Where to read command from. |
| sl2 | Where to copy the command. |
Definition at line 142 of file lowlevel.c.
| int SockList_ReadPacket | ( | socket_struct * | ns, |
| int | len | ||
| ) |
Reads from socket.
| ns | Socket to read from. |
| len | Max length of data to read. |
Definition at line 81 of file lowlevel.c.
| void write_cs_stats | ( | ) |
| void Write_String_To_Socket | ( | socket_struct * | ns, |
| char | cmd, | ||
| const char * | buf, | ||
| int | len | ||
| ) |
Takes a string of data, and writes it out to the socket. A very handy shortcut function.
Definition at line 412 of file lowlevel.c.
Last series of stats.
Definition at line 429 of file lowlevel.c.
Life of the server.
Definition at line 426 of file lowlevel.c.
1.7.4