00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00024 #ifndef SCALESTACK_NETWORK_IP_TCP_CONNECTION_SERVICE_H
00025 #define SCALESTACK_NETWORK_IP_TCP_CONNECTION_SERVICE_H
00026
00027 #include <string>
00028
00029 #include <scalestack/kernel/macros.h>
00030 #include <scalestack/network/stream_service.h>
00031
00032 namespace scalestack
00033 {
00034 namespace network
00035 {
00036 namespace ip
00037 {
00038 namespace tcp
00039 {
00040
00041 class connection;
00042
00046 class SCALESTACK_API connection_service: public stream_service_provider
00047 {
00048 public:
00049
00056 static void options(kernel::module& module, const char* addresses);
00057
00067 connection_service(kernel::module& module,
00068 std::auto_ptr<stream_service> stream_service,
00069 const std::string& default_port);
00070
00071 ~connection_service();
00072
00076 void add_accepted(int file_descriptor,
00077 struct sockaddr& peer,
00078 socklen_t peer_size);
00079
00084 void add_connections(void);
00085
00089 void add_connections(const std::string& addresses);
00090
00091 private:
00092
00096 SCALESTACK_LOCAL
00097 connection_service(const connection_service&);
00098
00102 SCALESTACK_LOCAL
00103 connection_service& operator=(const connection_service&);
00104
00105 std::string _default_port;
00106 };
00107
00108 }
00109 }
00110 }
00111 }
00112
00113 #endif