MeVisLab Toolbox Reference
asio::TcpAcceptorSession Class Reference

A TCP acceptor session continuously waiting for incoming connections. More...

#include <TcpAcceptorSession.h>

Inheritance diagram for asio::TcpAcceptorSession:
asio::SocketCreationSession< TcpAcceptorSession >

Public Member Functions

unsigned short port () const
 
void start ()
 
void stop ()
 
- Public Member Functions inherited from asio::SocketCreationSession< TcpAcceptorSession >
SignalConnection observeConnectionEstablished (Slot &&slot)
 
SignalConnection observeErrorOccured (Slot &&slot)
 
SignalConnection observeAboutToBeDestroyed (Slot &&slot)
 
 ~SocketCreationSession ()
 

Friends

class SocketCreationSession< TcpAcceptorSession >
 

Additional Inherited Members

- Static Public Member Functions inherited from asio::SocketCreationSession< TcpAcceptorSession >
static std::shared_ptr< TcpAcceptorSessioncreate (Arguments &&... arguments)
 
- Protected Member Functions inherited from asio::SocketCreationSession< TcpAcceptorSession >
void emitConnectionEstablished (std::unique_ptr< Socket > socket)
 
void emitErrorOccured (const ErrorCode &ec)
 

Detailed Description

A TCP acceptor session continuously waiting for incoming connections.

The session implements the asio::SocketCreationSession class template and signals asio::Socket interfaces for incoming connections. Synopsis:

auto context = std::make_shared<asio::Context>();
auto session = asio::TcpAcceptorSession::create(context, "127.0.0.1", 8080);
session->observeConnectionEstablished([](std::unique_ptr<asio::Socket>& socket) {
// new socket connected!
// do something with it.
});
session->start();
context->run(); // this blocks (as usual) and normally done somewhere else.
static std::shared_ptr< TcpAcceptorSession > create(Arguments &&... arguments)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.

Definition at line 33 of file TcpAcceptorSession.h.

Member Function Documentation

◆ port()

unsigned short asio::TcpAcceptorSession::port ( ) const

◆ start()

void asio::TcpAcceptorSession::start ( )

◆ stop()

void asio::TcpAcceptorSession::stop ( )

Friends And Related Symbol Documentation

◆ SocketCreationSession< TcpAcceptorSession >


The documentation for this class was generated from the following file: