… | |
… | |
56 | * Initializes a connection. Really, it just sets up the data structure, |
56 | * Initializes a connection. Really, it just sets up the data structure, |
57 | * socket setup is handled elsewhere. We do send a version to the |
57 | * socket setup is handled elsewhere. We do send a version to the |
58 | * client. |
58 | * client. |
59 | */ |
59 | */ |
60 | client_socket::client_socket (int fd, const char *peername) |
60 | client_socket::client_socket (int fd, const char *peername) |
61 | : fd (fd), host (strdup (peername)) |
61 | : fd (fd), host (strdup (peername)), |
|
|
62 | socket_ev (this, &client_socket::socket_cb) |
62 | { |
63 | { |
63 | { |
64 | { |
64 | struct linger linger_opt; |
65 | struct linger linger_opt; |
65 | |
66 | |
66 | linger_opt.l_onoff = 0; |
67 | linger_opt.l_onoff = 0; |
… | |
… | |
105 | * this face. Face 0 is sent to the client to say clear |
106 | * this face. Face 0 is sent to the client to say clear |
106 | * face information. |
107 | * face information. |
107 | */ |
108 | */ |
108 | faces_sent[0] = NS_FACESENT_FACE; |
109 | faces_sent[0] = NS_FACESENT_FACE; |
109 | |
110 | |
110 | can_write = 1; |
111 | socket_ev.fd (fd).poll (PE_W).start (); |
111 | |
112 | |
112 | // initialisation done, kick it! |
113 | // initialisation done, kick it! |
113 | |
114 | |
114 | { |
115 | { |
115 | packet sl; |
116 | packet sl; |