TcpClient

CreateTcpClient()

Create a TcpClient, that (after calling Connect()) will asynchronously try to connect to the given address and port.

Never returns nullptr.

Calls to CreateTcpClient() must be paired with calls to Close(TcpClient*)


ITcpEndpoint* CreateTcpClient(
    Iocp* iocp,
    ISocketConnectionAcceptor* acceptor,   // Can be nullptr
    boost::asio::ip::tcp::resolver::iterator endpoint_iterator);

ITcpEndpoint* CreateTcpClient(
    Iocp* iocp,
    ISocketConnectionAcceptor* acceptor,   // Can be nullptr
    const char* address,
    const char* port);

ITcpEndpoint* CreateTcpClient(
    Iocp* iocp,
    ISocketConnectionAcceptor* acceptor,  // Can be nullptr
    IPAddress address,
    SOCKET_PORT port);