1 /********************************************************************************
2  *                              Nepenthes
3  *                        - finest collection -
4  *
5  *
6  *
7  * Copyright (C) 2005  Paul Baecher & Markus Koetter
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22  *
23  *
24  *             contact nepenthesdev@users.sourceforge.net
25  *
26  *******************************************************************************/
27 
28 /* $Id: FILESocket.hpp 1410 2007-10-12 13:07:23Z common $ */
29 
30 #ifdef WIN32
31 
32 #else
33 
34 #include "Socket.hpp"
35 #include "Responder.hpp"
36 
37 
38 namespace nepenthes
39 {
40 	class Dialogue;
41 
42 	class FILESocket : public Socket
43 	{
44 public:
45     FILESocket(Nepenthes *nepenthes, char *filepath, int32_t flags);
46 	~FILESocket();
47 		bool bindPort();
48 		bool Init();
49 		bool Exit();
50 		bool connectHost();
51 		Socket * acceptConnection();
52 		bool wantSend();
53 
54 		int32_t doSend();
55 		int32_t doRecv();
56 		int32_t doWrite(char *msg, uint32_t len);
57 		bool checkTimeout();
58 		bool handleTimeout();
59 		bool doRespond(char *msg, uint32_t len);
60 		bool doRespond(const char *msg, uint32_t len);
61 
62 	private:
63 		string m_FilePath;
64 		int32_t m_Flags;
65 	};
66 }
67 
68 #endif
69