template <typename _SocketBase>
class server_socket_ : public _SocketBase
{
+ private:
+ int m_port_no;
+
public:
- server_socket_(){}
+ socket_server_(int listen_port_no) : m_port_no(listen_port_no) {}
+
+ /////////////////////////////////////////////////////
+
+ template <typename _ConnectionClass>
+ bool start()
+ {
+ for(;;)
+ {
+ ServerSocketImpl::accepted_info ai;
+ SocketType accepted = listener.listen_ex(
+ m_setup_info.listen_port_no, ai, false,
+ m_setup_info.socktype, m_setup_info.family);
+
+ thread th;
+ th.start();
+ }
+ }
};
typedef server_socket_<socket> tcp_server_socket, server_socket;