close_conn.c
496 Bytes
#include <string.h>
#include "server.h"
#include "interface/class.h"
void
serverCloseConn(Server this, unsigned int i)
{
int fd = (this->fds)[i].fd;
delete(&((this->conns)[fd].sock));
delete(&((this->conns)[fd].reader));
memset((this->conns)[fd].wbuf, 0, strlen((this->conns)[fd].wbuf));
(this->conns)[fd].keep_alive = 0;
(this->fds)[i].events = 0;
(this->fds)[i].revents = 0;
(this->fds)[i].fd = 0;
this->ndel++;
// CLEAR_CONN(this, i);
// this->nfds--;
}
// vim: set ts=4 sw=4: