예제 #1
0
void tcp_listener::stop_listening()
{
    if (!is_listening()) {
        return;
    }

    m_acceptor.close();
    set_listening(false);
}
예제 #2
0
void uds_listener::start_listening()
{
    if (is_listening()) {
        return;
    }

    unlink(m_endpoint.path().c_str());
    m_acceptor.open(m_endpoint.protocol());
    m_acceptor.set_option(
           boost::asio::local::stream_protocol::acceptor::reuse_address(true));
    m_acceptor.bind(m_endpoint);
    m_acceptor.listen();

    assert(get_accept_handler());
    set_listening(true);
    async_accept();
}
예제 #3
0
void tcp_listener::start_listening()
{
    assert(get_error_handler());
    assert(get_accept_handler());

    if (is_listening()) {
        return;
    }

    m_acceptor.open(m_endpoint.protocol());
    m_acceptor.set_option(
           boost::asio::ip::tcp::acceptor::reuse_address(true));
    m_acceptor.bind(m_endpoint);
    m_acceptor.listen();

    set_listening(true);
    async_accept();
}
예제 #4
0
NetworkedMultiplayerPeer::ConnectionStatus WebSocketServer::get_connection_status() const {
	if (is_listening())
		return CONNECTION_CONNECTED;

	return CONNECTION_DISCONNECTED;
};