Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/sernet.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
sernet.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__SERNET_H
14#define FC__SERNET_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20struct connection;
21
22#define BUF_SIZE 512
23
24#define SERVER_LAN_PORT 4555
25#define SERVER_LAN_TTL 1
26#define SERVER_LAN_VERSION 2
27
28 enum server_events {
29 S_E_END_OF_TURN_TIMEOUT,
30 S_E_OTHERWISE,
31 S_E_FORCE_END_OF_SNIFF,
32};
33
34enum server_events server_sniff_all_input(void);
35
36int server_open_socket(void);
37void flush_packets(void);
38void close_connections_and_socket(void);
39void init_connections(void);
40int server_make_connection(int new_sock,
41 const char *client_addr, const char *client_ip);
42void handle_conn_pong(struct connection *pconn);
43void handle_client_heartbeat(struct connection *pconn);
44
45void readline_atexit(void);
46
47#ifdef __cplusplus
48}
49#endif /* __cplusplus */
50
51#endif /* FC__SERNET_H */
server_events
server_events
Definition sernet.h:28
S_E_OTHERWISE
@ S_E_OTHERWISE
Definition sernet.h:30
S_E_END_OF_TURN_TIMEOUT
@ S_E_END_OF_TURN_TIMEOUT
Definition sernet.h:29
S_E_FORCE_END_OF_SNIFF
@ S_E_FORCE_END_OF_SNIFF
Definition sernet.h:31
server_open_socket
int server_open_socket(void)
Definition sernet.c:1127
flush_packets
void flush_packets(void)
Definition sernet.c:379
init_connections
void init_connections(void)
Definition sernet.c:1355
server_make_connection
int server_make_connection(int new_sock, const char *client_addr, const char *client_ip)
Definition sernet.c:1067
handle_conn_pong
void handle_conn_pong(struct connection *pconn)
Definition sernet.c:1431
server_sniff_all_input
enum server_events server_sniff_all_input(void)
Definition sernet.c:524
handle_client_heartbeat
void handle_client_heartbeat(struct connection *pconn)
Definition sernet.c:1451
readline_atexit
void readline_atexit(void)
Definition sernet.c:209
close_connections_and_socket
void close_connections_and_socket(void)
Definition sernet.c:259
connection
Definition connection.h:141