/// A wrapper class for the transmission control protocol socket.
classTCP:publicBaseTCP
{
protected:
Sockethdl;
public:
/// Frees any native handles.
~TCP()override;
/// Default members initialization.
TCP();
TCP(constAddrTypeaddrType);
TCP(TCP&&tcp)noexcept;
/// Copies some members from the given TCP object.
/// @param [in] tcp The TCP object to copy from.
TCP(constTCP&tcp);
TCP&operator=(TCP&&tcp)noexcept;
/// Copies some members from the given TCP object.
/// @param [in] tcp The TCP object to copy from.
/// @returns The TCP object that has been assigned to.
TCP&operator=(constTCP&tcp);
voidInitialize()override;
/// Frees native handles and uninitializes them.
voidRelease()override;
/// Binds the UDP socket to a local address and port.
/// @param [in] address The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
/// @param [in] port The port to bind to.
/// @note Requires the port given to be forwarded if this is called.
/// Listens for incoming connections. Used for servers or PtP.
voidListen()override;
/// Accepts an incoming connection. Used for servers or PtP.
/// @returns The accepted client object.
TCP*Accept()override;
/// Connects to a TCP Socket that listens for incoming connections. Used for clients or PtP.
/// @param address The address of the listening TCP socket. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
/// @param port The port of the listening TCP socket.