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_PROXY_SERVER_H 00025 #define SCALESTACK_PROXY_SERVER_H 00026 00027 #include <scalestack/network/stream.h> 00028 00029 namespace scalestack 00030 { 00031 namespace proxy 00032 { 00033 00034 class client; 00035 class server_service; 00036 00037 class server: public network::stream 00038 { 00039 public: 00040 00041 server(kernel::module& module, server_service& server_service); 00042 00046 void shutdown(void); 00047 00051 void run(void); 00052 00056 void connected(void); 00057 00061 size_t read(uint8_t* buffer, size_t size); 00062 00066 void flush_write(void); 00067 00071 void continue_write(void); 00072 00073 private: 00074 00078 server(const server&); 00079 00083 server& operator=(const server&); 00084 00089 size_t _client_write(void); 00090 00091 size_t _size; 00092 uint8_t* _buffer; 00093 client* _client; 00094 server_service& _server_service; 00095 }; 00096 00097 } /* namespace proxy */ 00098 } /* namespace scalestack */ 00099 00100 #endif /* SCALESTACK_PROXY_SERVER_H */
1.6.3