Freeciv-3.1
|
Go to the source code of this file.
Macros | |
#define | BUF_SIZE 512 |
#define | SERVER_LAN_PORT 4555 |
#define | SERVER_LAN_TTL 1 |
#define | SERVER_LAN_VERSION 2 |
Enumerations | |
enum | server_events { S_E_END_OF_TURN_TIMEOUT , S_E_OTHERWISE , S_E_FORCE_END_OF_SNIFF } |
Functions | |
enum server_events | server_sniff_all_input (void) |
int | server_open_socket (void) |
void | flush_packets (void) |
void | close_connections_and_socket (void) |
void | init_connections (void) |
int | server_make_connection (int new_sock, const char *client_addr, const char *client_ip) |
void | handle_conn_pong (struct connection *pconn) |
void | handle_client_heartbeat (struct connection *pconn) |
void | readline_atexit (void) |
enum server_events |
void close_connections_and_socket | ( | void | ) |
Close all network stuff: connections, listening sockets, metaserver connection...
Definition at line 259 of file sernet.c.
Referenced by server_quit().
void flush_packets | ( | void | ) |
Attempt to flush all information in the send buffers for upto 'netwait' seconds.
Definition at line 379 of file sernet.c.
Referenced by begin_phase(), dai_do_first_activities(), end_phase(), send_all_known_cities(), send_all_known_tiles(), and send_all_known_units().
void handle_client_heartbeat | ( | struct connection * | pconn | ) |
void handle_conn_pong | ( | struct connection * | pconn | ) |
void init_connections | ( | void | ) |
Initialize connection related stuff. Attention: Logging is not available within this functions!
Definition at line 1355 of file sernet.c.
Referenced by main(), and srv_prepare().
void readline_atexit | ( | void | ) |
Clear readline stuff at exit. To cater for as many different cases as possible, we call this both like any function call from server_quit() before exit(), and as a atexit handler. Former is to get everything cleared already before exit(), before any other atexit handler comes to play. Latter is to make sure that the function gets called also when in those rare cases where we exit some other way than server_quit() - that's important for always restoring terminal to a working state.
That means that in usual case this function gets called twice. Make sure that it doesn't try double frees or similar when that happens.
Definition at line 209 of file sernet.c.
Referenced by server_quit(), and server_sniff_all_input().
int server_make_connection | ( | int | new_sock, |
const char * | client_addr, | ||
const char * | client_ip | ||
) |
Server accepts connection from client: Low level socket stuff, and basic-initialize the connection struct. Returns 0 on success, -1 on failure (bad accept(), or too many connections).
Definition at line 1067 of file sernet.c.
Referenced by server_accept_connection().
int server_open_socket | ( | void | ) |
Open server socket to be used to accept client connections and open a server socket for server LAN announcements.
Definition at line 1127 of file sernet.c.
Referenced by srv_prepare().
enum server_events server_sniff_all_input | ( | void | ) |
Get and handle:
This function also handles prompt printing, via the con_prompt_* functions. That is, other functions should not need to do so. –dwp
Definition at line 524 of file sernet.c.
Referenced by srv_main(), and srv_running().