| 2154 | } |
| 2155 | |
| 2156 | static rem_port* select_accept( rem_port* main_port) |
| 2157 | { |
| 2158 | /************************************** |
| 2159 | * |
| 2160 | * s e l e c t _ a c c e p t |
| 2161 | * |
| 2162 | ************************************** |
| 2163 | * |
| 2164 | * Functional description |
| 2165 | * Accept a new connection request. |
| 2166 | * |
| 2167 | **************************************/ |
| 2168 | |
| 2169 | rem_port* const port = alloc_port(main_port); |
| 2170 | inet_ports->registerPort(port); |
| 2171 | |
| 2172 | port->port_handle = os_utils::accept(main_port->port_handle, NULL, NULL); |
| 2173 | if (port->port_handle == INVALID_SOCKET) |
| 2174 | { |
| 2175 | inet_error(true, port, "accept", isc_net_connect_err, INET_ERRNO); |
| 2176 | } |
| 2177 | |
| 2178 | setKeepAlive(port->port_handle); |
| 2179 | |
| 2180 | port->port_flags |= PORT_server; |
| 2181 | |
| 2182 | if (main_port->port_server_flags & SRVR_thread_per_port) |
| 2183 | { |
| 2184 | port->port_server_flags = (SRVR_server | SRVR_inet | SRVR_thread_per_port); |
| 2185 | return port; |
| 2186 | } |
| 2187 | |
| 2188 | return 0; |
| 2189 | } |
| 2190 | |
| 2191 | static void select_port(rem_port* main_port, Select* selct, RemPortPtr& port) |
| 2192 | { |
no test coverage detected