00001 /* 00002 * tcpserver.h 00003 * 00004 * Created on: 29.07.2009 00005 * Author: morgenro 00006 */ 00007 00008 #ifndef IBRCOMMON_TCPSERVER_H_ 00009 #define IBRCOMMON_TCPSERVER_H_ 00010 00011 #include "ibrcommon/net/tcpstream.h" 00012 #include "ibrcommon/net/NetInterface.h" 00013 #include <netinet/in.h> 00014 #include "ibrcommon/Exceptions.h" 00015 00016 namespace ibrcommon 00017 { 00018 class tcpserver 00019 { 00020 public: 00025 tcpserver(NetInterface net, int port); 00026 00030 virtual ~tcpserver(); 00031 00036 tcpstream* accept(); 00037 00038 void close(); 00039 00040 private: 00041 int _socket; 00042 bool _closed; 00043 00044 }; 00045 } 00046 00047 #endif /* TCPSERVER_H_ */
1.6.3