--- deliantra/server/socket/lowlevel.C 2006/12/14 01:59:10 1.15 +++ deliantra/server/socket/lowlevel.C 2006/12/14 05:09:32 1.18 @@ -53,7 +53,7 @@ #define SOCKET_TIMEOUT2 20 void -Socket_Flush (NewSocket * ns) +Socket_Flush (client_socket * ns) { #ifdef __linux__ // check time of last ack, and, if too old, kill connection @@ -142,7 +142,7 @@ ******************************************************************************/ int -NewSocket::read_packet () +client_socket::read_packet () { for (;;) { @@ -188,7 +188,7 @@ } void -NewSocket::skip_packet (int len) +client_socket::skip_packet (int len) { inbuf_len -= len; memmove (inbuf, inbuf + len, inbuf_len); @@ -208,7 +208,7 @@ */ static void -add_to_buffer (NewSocket *ns, char *buf, int len) +add_to_buffer (client_socket *ns, char *buf, int len) { int avail, end; @@ -252,7 +252,7 @@ * is called to write it out. */ void -write_socket_buffer (NewSocket * ns) +write_socket_buffer (client_socket * ns) { int amt, max; @@ -311,7 +311,7 @@ * updates the ns structure if we get an error. */ void -NewSocket::send (void *buf_, int len) +client_socket::send (void *buf_, int len) { char *buf = (char *)buf_; char *pos = buf; @@ -378,13 +378,13 @@ */ void -NewSocket::send_packet (packet &sl) +client_socket::send_packet (packet &sl) { Send_With_Handling (this, &sl); } void -NewSocket::send_packet (const char *buf, int len) +client_socket::send_packet (const char *buf, int len) { packet sl; @@ -393,7 +393,7 @@ } void -NewSocket::send_packet (const char *buf) +client_socket::send_packet (const char *buf) { send_packet (buf, strlen (buf)); } @@ -405,7 +405,7 @@ *, and we prepend the length information. */ void -Send_With_Handling (NewSocket *ns, packet *msg) +Send_With_Handling (client_socket *ns, packet *msg) { unsigned char sbuf[4]; @@ -424,9 +424,8 @@ sbuf[0] = ((uint32) (msg->length ()) >> 8); sbuf[1] = ((uint32) (msg->length ()) ); - if (ns->status != Ns_Old) - ns->send (sbuf, 2); - + //TODO: single write, or writev + ns->send (sbuf, 2); ns->send (msg->buf, msg->length ()); } @@ -461,7 +460,6 @@ now - cst_tot.time_start, cst_lst.ibytes, cst_lst.obytes, cst_lst.max_conn, now - cst_lst.time_start); cst_lst.ibytes = 0; cst_lst.obytes = 0; - cst_lst.max_conn = socket_info.nconns; cst_lst.time_start = now; } #endif