Fawkes API  Fawkes Development Version
fuse_server.h
1 
2 /***************************************************************************
3  * fuse_server.h - network image transport server interface
4  *
5  * Generated: Mon Jan 09 15:26:27 2006
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_FVUTILS_NET_FUSE_SERVER_H_
25 #define _FIREVISION_FVUTILS_NET_FUSE_SERVER_H_
26 
27 #include <core/threading/thread.h>
28 #include <core/utils/lock_list.h>
29 #include <netcomm/utils/incoming_connection_handler.h>
30 
31 #include <string>
32 #include <vector>
33 
34 namespace fawkes {
35 class ThreadCollector;
36 class StreamSocket;
37 class NetworkAcceptorThread;
38 } // namespace fawkes
39 namespace firevision {
40 
41 class FuseServerClientThread;
42 
44 {
45 public:
46  FuseServer(bool enable_ipv4,
47  bool enable_ipv6,
48  const std::string & listen_ipv4,
49  const std::string & listen_ipv6,
50  unsigned short int port,
51  fawkes::ThreadCollector *collector = 0);
52  virtual ~FuseServer();
53 
54  virtual void add_connection(fawkes::StreamSocket *s) throw();
55  void connection_died(FuseServerClientThread *client) throw();
56 
57  virtual void loop();
58 
59 private:
60  std::vector<fawkes::NetworkAcceptorThread *> acceptor_threads_;
61 
64 
66 
67  fawkes::ThreadCollector *thread_collector_;
68 };
69 
70 } // end namespace firevision
71 
72 #endif
fawkes::ThreadCollector
Thread collector.
Definition: thread_collector.h:34
firevision::FuseServer::FuseServer
FuseServer(bool enable_ipv4, bool enable_ipv6, const std::string &listen_ipv4, const std::string &listen_ipv6, unsigned short int port, fawkes::ThreadCollector *collector=0)
Constructor.
Definition: fuse_server.cpp:56
firevision::FuseServer::loop
virtual void loop()
Code to execute in the thread.
Definition: fuse_server.cpp:135
firevision::FuseServer
FireVision FUSE protocol server.
Definition: fuse_server.h:44
firevision::FuseServer::add_connection
virtual void add_connection(fawkes::StreamSocket *s)
Add an incoming connection.
Definition: fuse_server.cpp:113
fawkes::LockList
List with a lock.
Definition: lock_list.h:45
fawkes
Fawkes library namespace.
firevision::FuseServer::connection_died
void connection_died(FuseServerClientThread *client)
Connection died.
Definition: fuse_server.cpp:128
firevision::FuseServerClientThread
FUSE Server Client Thread.
Definition: fuse_server_client_thread.h:45
fawkes::Thread
Thread class encapsulation of pthreads.
Definition: thread.h:46
fawkes::NetworkIncomingConnectionHandler
Interface for handling incoming connections.
Definition: incoming_connection_handler.h:32
firevision::FuseServer::~FuseServer
virtual ~FuseServer()
Destructor.
Definition: fuse_server.cpp:86
fawkes::StreamSocket
TCP stream socket over IP.
Definition: stream.h:32