… | |
… | |
39 | #include <sys/time.h> |
39 | #include <sys/time.h> |
40 | #include <sys/socket.h> |
40 | #include <sys/socket.h> |
41 | #include <netinet/in.h> |
41 | #include <netinet/in.h> |
42 | #include <netdb.h> |
42 | #include <netdb.h> |
43 | |
43 | |
44 | #ifdef HAVE_UNISTD_H |
|
|
45 | # include <unistd.h> |
44 | #include <unistd.h> |
46 | #endif |
|
|
47 | |
|
|
48 | #ifdef HAVE_ARPA_INET_H |
|
|
49 | # include <arpa/inet.h> |
45 | #include <arpa/inet.h> |
50 | #endif |
|
|
51 | #include <newserver.h> |
46 | #include <newserver.h> |
52 | |
47 | |
53 | sockvec client_sockets; |
48 | sockvec client_sockets; |
54 | |
49 | |
55 | /** |
50 | /** |
… | |
… | |
106 | * this face. Face 0 is sent to the client to say clear |
101 | * this face. Face 0 is sent to the client to say clear |
107 | * face information. |
102 | * face information. |
108 | */ |
103 | */ |
109 | faces_sent[0] = NS_FACESENT_FACE; |
104 | faces_sent[0] = NS_FACESENT_FACE; |
110 | |
105 | |
111 | socket_ev.fd (fd).poll (PE_W).start (); |
106 | socket_ev.fd (fd); |
112 | |
107 | |
113 | // initialisation done, kick it! |
108 | // initialisation done, kick it! |
114 | |
109 | |
115 | { |
110 | { |
116 | packet sl; |
111 | packet sl; |
117 | sl.printf ("version %d %d %s\n", VERSION_CS, VERSION_SC, VERSION_INFO); |
112 | sl.printf ("version %d %d %s\n", VERSION_CS, VERSION_SC, VERSION_INFO); |
118 | send_packet (sl); |
113 | send_packet (sl); |
|
|
114 | flush (); |
119 | } |
115 | } |
120 | |
116 | |
121 | #if 0//TODO |
117 | #if 0//TODO |
122 | socket_info.nconns++; |
118 | socket_info.nconns++; |
123 | if (socket_info.nconns > cst_tot.max_conn) cst_tot.max_conn = socket_info.nconns; |
119 | if (socket_info.nconns > cst_tot.max_conn) cst_tot.max_conn = socket_info.nconns; |