|
server 0.0.1
basicserverinfrastructure
|
00001 static 00002 int 00003 serverRead(Server this, unsigned int i) 00004 { 00005 int fd = (this->fds)[i].fd; 00006 int size; 00007 00008 if (NULL == (this->conns)[fd].reader) { 00009 loggerLog( 00010 this->logger, 00011 LOGGER_INFO, 00012 "initialization error: NULL reader"); 00013 serverCloseConn(this, i); 00014 } 00015 00016 switch ((size = streamReaderRead((this->conns)[fd].reader, fd))) { 00017 case 0: 00018 /* 00019 * normal close: write remaining data 00020 * @TODO: actually we have no remaining data here.... 00021 */ 00022 /* DROP-THROUGH */ 00023 00024 case -1: 00025 /* 00026 * read failure / close connection 00027 */ 00028 loggerLog(this->logger, LOGGER_INFO, "connection closed..."); 00029 serverCloseConn(this, i); 00030 break; 00031 00032 default: 00033 break; 00034 } 00035 00036 return size; 00037 } 00038 00039 // vim: set ts=4 sw=4: