|
Twitch SDK (Internal)
|
#include <socket.h>
Public Member Functions | |
| virtual | ~ISocket ()=default |
| virtual TTV_ErrorCode | Connect ()=0 |
| virtual TTV_ErrorCode | Disconnect ()=0 |
| virtual TTV_ErrorCode | Send (const uint8_t *buffer, size_t length) |
| virtual TTV_ErrorCode | Send (const uint8_t *buffer, size_t length, size_t &sent)=0 |
| virtual TTV_ErrorCode | Recv (uint8_t *buffer, size_t length, size_t &received)=0 |
| virtual uint64_t | TotalSent ()=0 |
| virtual uint64_t | TotalReceived ()=0 |
| virtual bool | Connected ()=0 |
This interface provides generic, synchronous access to a socket. It can wrap any low-level bidirectional byte stream. An instance of ISocket is generally bound to a single endpoint. The connection can be opened and closed as many times as desired but it can't be changed to point to another peer.
|
virtualdefault |
Destructor.
|
pure virtual |
Synchronously connects to the endpoint.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::WinAppSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
pure virtual |
Determines if the socket is currently connected.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::WinAppSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
pure virtual |
Synchronously disconnects from the endpoint. It is safe to call Disconnect() if not connected.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::WinAppSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
pure virtual |
Attempts to receive some bytes from the socket.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The largest number of bytes to receive. |
| [out] | received | The number of bytes actually received. |
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::WinAppSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
virtual |
Attempts to send some bytes over the socket. This flavor of Send() is a helper which guarantees that all bytes are sent or where is an error on the socket.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The number of bytes to send. |
Reimplemented in ttv::WinAppSocket.
|
pure virtual |
Attempts to send some bytes over the socket. It's possible that the socket is unable to send able to send any more bytes right now but will be in the near future. Thus, the number actually sent may be less than the size of the passed in buffer.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The number of bytes to send. |
| [out] | sent | The number of bytes actually sent. |
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
pure virtual |
Returns the total number of bytes that have been received from the socket during the current connection.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
|
pure virtual |
Returns the total number of bytes that have been sent over the socket during the current connection.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
1.8.13