00001 /* 00002 * Scale Stack 00003 * 00004 * Copyright 2010 Eric Day 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00024 #ifndef SCALESTACK_NETWORK_LOCAL_STREAM_CONNECTION_SERVICE_H 00025 #define SCALESTACK_NETWORK_LOCAL_STREAM_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 local 00037 { 00038 namespace stream 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 00066 connection_service(kernel::module& module, 00067 std::auto_ptr<stream_service> stream_service); 00068 00069 ~connection_service(); 00070 00074 void add_accepted(int file_descriptor, 00075 struct sockaddr& peer, 00076 socklen_t peer_size); 00077 00082 void add_connections(void); 00083 00087 void add_connections(const std::string& addresses); 00088 00089 private: 00090 00094 SCALESTACK_LOCAL 00095 connection_service(const connection_service&); 00096 00100 SCALESTACK_LOCAL 00101 connection_service& operator=(const connection_service&); 00102 }; 00103 00104 } /* namespace stream */ 00105 } /* namespace local */ 00106 } /* namespace network */ 00107 } /* namespace scalestack */ 00108 00109 #endif /* SCALESTACK_NETWORK_LOCAL_STREAM_CONNECTION_SERVICE_H */
1.6.3