#include <winappsocket.h>
◆ WinAppSocket()
| ttv::WinAppSocket::WinAppSocket |
( |
| ) |
|
◆ ~WinAppSocket()
| virtual ttv::WinAppSocket::~WinAppSocket |
( |
| ) |
|
|
virtual |
◆ Connect()
Synchronously connects to the endpoint.
- See also
- Disconnect
- Returns
- TTV_EC_SUCCESS: The socket has successfully connected and is ready to exchange data.
- TTV_EC_SOCKET_EALREADY: Already connected.
- TTV_EC_SOCKET_ETIMEDOUT: The connection timed out.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Implements ttv::ISocket.
◆ Connected()
| virtual bool ttv::WinAppSocket::Connected |
( |
| ) |
|
|
virtual |
Determines if the socket is currently connected.
- Returns
- Whether or not currently connected.
Implements ttv::ISocket.
◆ Disconnect()
Synchronously disconnects from the endpoint. It is safe to call Disconnect() if not connected.
- See also
- Connect
- Returns
- TTV_EC_SUCCESS: The socket has successfully disconnected.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Implements ttv::ISocket.
◆ Initialize()
| TTV_ErrorCode ttv::WinAppSocket::Initialize |
( |
const std::string & |
host, |
|
|
const std::string & |
port |
|
) |
| |
◆ ReadAndResetInputBuffer()
| HRESULT ttv::WinAppSocket::ReadAndResetInputBuffer |
( |
uint8_t * |
buffer, |
|
|
size_t |
length, |
|
|
UINT32 & |
readLength |
|
) |
| |
|
private |
◆ Recv()
| virtual TTV_ErrorCode ttv::WinAppSocket::Recv |
( |
uint8_t * |
buffer, |
|
|
size_t |
length, |
|
|
size_t & |
received |
|
) |
| |
|
virtual |
Attempts to receive some bytes from the socket.
- Parameters
-
| [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. |
- Returns
- TTV_EC_SUCCESS: Some bytes have been received.
- TTV_EC_SOCKET_EWOULDBLOCK: The socket is connected but there aren't any bytes available to be read.
- TTV_EC_SOCKET_ENOTCONN: The socket is not connected.
- TTV_EC_SOCKET_ECONNABORTED: The connected was dropped.
- TTV_EC_SOCKET_ETIMEDOUT: The connection timed out.
- TTV_EC_SOCKET_ECONNRESET: The connection was closed by the remote host.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Implements ttv::ISocket.
◆ Send() [1/2]
| virtual TTV_ErrorCode ttv::WinAppSocket::Send |
( |
const uint8_t * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
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.
- Parameters
-
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The number of bytes to send. |
- Returns
- TTV_EC_SUCCESS: The bytes have been sent.
- TTV_EC_SOCKET_ENOTCONN: The socket is not connected.
- TTV_EC_SOCKET_ECONNABORTED: The connected was dropped.
- TTV_EC_SOCKET_ETIMEDOUT: The connection timed out.
- TTV_EC_SOCKET_ECONNRESET: The connection was closed by the remote host.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Reimplemented from ttv::ISocket.
◆ Send() [2/2]
| virtual TTV_ErrorCode ttv::ISocket::Send |
( |
const uint8_t * |
buffer, |
|
|
size_t |
length, |
|
|
size_t & |
sent |
|
) |
| |
|
pure virtualinherited |
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.
- Parameters
-
| [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. |
- Returns
- TTV_EC_SUCCESS: Some bytes have been sent.
- TTV_EC_SOCKET_EWOULDBLOCK: The socket is connected but wasn't able to send any bytes right now.
- TTV_EC_SOCKET_ENOTCONN: The socket is not connected.
- TTV_EC_SOCKET_ECONNABORTED: The connected was dropped.
- TTV_EC_SOCKET_ETIMEDOUT: The connection timed out.
- TTV_EC_SOCKET_ECONNRESET: The connection was closed by the remote host.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Implemented in ttv::binding::java::JavaSocket, ttv::WinSocket, ttv::OpenSslSocket, ttv::CFSocket, ttv::StandardFileSocket, and ttv::StandardSocket.
◆ TotalReceived() [1/2]
| virtual uint64_t ttv::WinAppSocket::TotalReceived |
( |
| ) |
const |
|
virtual |
◆ TotalReceived() [2/2]
| virtual uint64_t ttv::ISocket::TotalReceived |
( |
| ) |
|
|
pure virtualinherited |
◆ TotalSent() [1/2]
| virtual uint64_t ttv::WinAppSocket::TotalSent |
( |
| ) |
const |
|
virtual |
◆ TotalSent() [2/2]
| virtual uint64_t ttv::ISocket::TotalSent |
( |
| ) |
|
|
pure virtualinherited |
◆ mAsyncReadInProgress
| bool ttv::WinAppSocket::mAsyncReadInProgress |
|
private |
◆ mAsyncReadOp
| Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncOperationWithProgress<ABI::Windows::Storage::Streams::IBuffer*, UINT32> > ttv::WinAppSocket::mAsyncReadOp |
|
private |
◆ mBufferFactory
| Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBufferFactory> ttv::WinAppSocket::mBufferFactory |
|
private |
◆ mHostName
| std::string ttv::WinAppSocket::mHostName |
|
private |
◆ mInputBuffer
| Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBuffer> ttv::WinAppSocket::mInputBuffer |
|
private |
◆ mLastSocketError
| int ttv::WinAppSocket::mLastSocketError |
|
private |
◆ mPort
| std::string ttv::WinAppSocket::mPort |
|
private |
◆ mSocket
| Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocket> ttv::WinAppSocket::mSocket |
|
private |
◆ mTotalRecieved
| uint64_t ttv::WinAppSocket::mTotalRecieved |
|
private |
◆ mTotalSent
| uint64_t ttv::WinAppSocket::mTotalSent |
|
private |
The documentation for this class was generated from the following file: