1 #ifndef _YI_TCPSOCKET_H_ 2 #define _YI_TCPSOCKET_H_ 8 class CYITCPSocketPriv;
29 static std::unique_ptr<CYITCPSocket>
Create(
const CYIString &host, uint16_t uPort);
35 static std::unique_ptr<CYITCPSocket>
Create(int32_t nSocketDescriptor,
const CYIString &host, uint16_t uPort);
39 virtual bool Connect()
override;
64 bool SetSocketOptions(int32_t nLevel, int32_t nName,
void *pOption, uint32_t uSize);
89 bool Listen(int32_t bBacklog)
const;
96 std::unique_ptr<CYITCPSocket>
Accept()
const;
97 std::unique_ptr<CYITCPSocket>
TryAccept()
const;
106 CYITCPSocketPriv *m_pPriv;
virtual void SetConnectionTimeoutMs(uint32_t uTimeoutMs) override
virtual bool Disconnect() override
SOCKET_RESULT
Possible return values from socket operations.
Definition: YiSocket.h:25
bool Listen(int32_t bBacklog) const
CYITCPSocket(const CYIString &host, uint16_t uPort)
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
std::unique_ptr< CYITCPSocket > Accept() const
virtual IYISocket::SOCKET_RESULT TryReceive(char *pBuffer, size_t uLength, size_t &uReceived)
static std::unique_ptr< CYITCPSocket > Create(const CYIString &host, uint16_t uPort)
virtual uint64_t GetTotalBytesReceived() const override
virtual bool IsConnected() const override
virtual IYISocket::SOCKET_RESULT Receive(char *pBuffer, size_t uLength, size_t &uReceived) override
virtual IYISocket::SOCKET_RESULT Send(const char *pBuffer, size_t uLength) override
bool SetSocketBlockingEnabled(bool bBlocking) override
virtual uint64_t GetTotalBytesSent() const override
virtual uint32_t GetConnectionTimeoutMs() const override
The IYISocket defines the interface to be implemented by any class fulfilling sockets services...
Definition: YiSocket.h:19
std::unique_ptr< CYITCPSocket > TryAccept() const
virtual bool Connect() override
Implements a basic TCP socket.
Definition: YiTCPSocket.h:22
bool SetSocketOptions(int32_t nLevel, int32_t nName, void *pOption, uint32_t uSize)