Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Windows

TcpSocketBase class

An IPv4 or IPv6 TCP socket.

Use
import ThinkMeta.ConcurrentTasks.Windows.TcpSocket;
Namespace
ThinkMeta::ConcurrentTasks::Windows
Inherits
IpSocketBase

Syntax

template <IpVersionType _IpVersion, SocketType _BaseSocket> class TcpSocketBase

Template parameters

_IpVersionIpVersionType
The IP version: IpVersion::V4 or IpVersion::V6.
_BaseSocketSocketType
The socket class built on: Socket (blocking calls) or AsyncIo::AsyncSocket.

Remarks

Plain (Socket) or asynchronous (AsyncIo::AsyncSocket). Owns its socket like Socket.

See also

TcpSocket, AsyncIo::AsyncTcpSocket

Names

NameDescription
TcpSocket A plain (non-task-aware) TCP socket of the given version.
TcpSocket4 Plain IPv4 TCP socket.
TcpSocket6 Plain IPv6 TCP socket.

Constructors

TcpSocketBase

Creates an object without a socket.

Syntax

TcpSocketBase() noexcept = default;

Takes over other's socket; other is left without one.

Syntax

TcpSocketBase(TcpSocketBase&& other) noexcept;

Parameters

otherTcpSocketBase&&
The object whose socket is taken over; it holds no socket afterwards.

Methods

operator=

Takes over other's socket; a socket this object already holds is closed first.

Syntax

TcpSocketBase& operator=(TcpSocketBase&& other) noexcept;

Parameters

otherTcpSocketBase&&
The object whose socket is taken over; it holds no socket afterwards.

Return value

Type: TcpSocketBase&

This object.

Create

Creates a TCP socket of the version's address family.

Syntax

WinsockErrorCode Create(
    WSAPROTOCOL_INFO* protocolInfo = nullptr,
    GROUP g = 0,
    DWORD flags = 0
) noexcept;

Parameters

protocolInfoWSAPROTOCOL_INFO*
Optional WSAPROTOCOL_INFO that selects the provider; nullptr for the default.Default: nullptr
gGROUP
The socket group (0 for none, which is the usual value).Default: 0
flagsDWORD
WSA_FLAG_* flags, e.g. WSA_FLAG_OVERLAPPED (an asynchronous socket adds it itself).Default: 0

Return value

Type: WinsockErrorCode

WinsockError::Success, or the WSA error of WSASocket; for an asynchronous socket also the error of the completion port association (see AsyncIo::AsyncSocket::Create).

Remarks

Parameters as WSASocket. Needs Socket::Startup. An asynchronous socket (AsyncIo::AsyncTcpSocket) is created overlapped and associated with the core's completion port, which needs AsyncIo::EnableAsyncIo.

See also

Socket::Close

Types

SockAddr

The version's socket address type (sockaddr_in or sockaddr_in6).

Syntax

using SockAddr = typename _Traits::SockAddr;

Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).