Tanl Linguistic Pipeline |
00001 /* 00002 ** IXE 00003 ** io/ServerSocket.h 00004 ** ---------------------------------------------------------------------- 00005 ** Copyright (c) 2004 Giuseppe Attardi (attardi@di.unipi.it). 00006 ** ---------------------------------------------------------------------- 00007 ** 00008 ** This file is part of IXE. 00009 ** 00010 ** IXE is free software; you can redistribute it and/or modify it 00011 ** under the terms of the GNU General Public License, version 3, 00012 ** as published by the Free Software Foundation. 00013 ** 00014 ** IXE is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 ** GNU General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU General Public License 00020 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 ** ---------------------------------------------------------------------- 00022 */ 00023 00024 #ifndef IXE_io_ServerSocket_H 00025 #define IXE_io_ServerSocket_H 00026 00027 #include "io/Socket.h" 00028 00029 namespace IXE { 00030 namespace io { 00031 00036 class ServerSocket : public AbstractSocket 00037 { 00038 public: 00039 ServerSocket() { } 00040 00046 ServerSocket(int port, int backLog = 10); 00047 00051 ServerSocket(ServerSocket const& other) { copy(other); } 00052 00053 ServerSocket& operator =(const ServerSocket& rhs) 00054 { 00055 if (&rhs != this) { 00056 close(); 00057 copy(rhs); 00058 } 00059 return *this; 00060 } 00061 00068 Socket accept(); 00069 00073 SOCKET filedes() { return sock; } 00074 00075 private: 00076 int backLog; 00077 }; 00078 00079 } // io 00080 } // IXE 00081 00082 #endif // IXE_io_ServerSocket_H