server 0.0.1
basicserverinfrastructure

src/server/handle_accept.c

Go to the documentation of this file.
00001 static
00002 void
00003 serverHandleAccept(Server this)
00004 {
00005         char remoteAddr[16] = "";
00006         Sock acc;
00007 
00008         acc = socketAccept(this->sock, remoteAddr);
00009 
00010         if (-1 != acc->handle) {
00011                 //* save the socket handle
00012                 (this->conns)[acc->handle].sock   = acc; 
00013 
00014                 //* clone reader
00015                 (this->conns)[acc->handle].reader = clone(this->reader);
00016 
00017                 (this->fds)[this->nfds].fd        = acc->handle;
00018                 (this->fds)[this->nfds].events    = POLLIN;
00019                 this->nfds++;
00020         } else {
00021                 delete(&acc);
00022         }
00023 
00024 //      (this->fds)[0].revents |= POLLIN;
00025 }
00026 
00027 // vim: set ts=4 sw=4:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines