#include <java_socket.h>
◆ MessageType
The type of data in a frame.
| Enumerator |
|---|
| None | No data.
|
| Binary | A binary frame.
|
| Text | A text frame.
|
| Unknown | An unknown/unhandled frame type.
|
◆ JavaWebSocket()
| ttv::binding::java::JavaWebSocket::JavaWebSocket |
( |
JNIEnv * |
jEnv, |
|
|
jobject |
jInstance |
|
) |
| |
◆ ~JavaWebSocket()
| virtual ttv::binding::java::JavaWebSocket::~JavaWebSocket |
( |
| ) |
|
|
virtual |
◆ AllocateByteArray()
| void ttv::binding::java::JavaSocketBase::AllocateByteArray |
( |
size_t |
size | ) |
|
|
protectedinherited |
◆ Connect()
| virtual TTV_ErrorCode ttv::binding::java::JavaWebSocket::Connect |
( |
| ) |
|
|
overridevirtual |
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::IWebSocket.
◆ Connected()
| virtual bool ttv::binding::java::JavaWebSocket::Connected |
( |
| ) |
|
|
overridevirtual |
Determines if the socket is currently connected.
- Returns
- Whether or not currently connected.
Implements ttv::IWebSocket.
◆ Disconnect()
| virtual TTV_ErrorCode ttv::binding::java::JavaWebSocket::Disconnect |
( |
| ) |
|
|
overridevirtual |
Synchronously disconnects from the endpoint.
- See also
- Connect
- Returns
- TTV_EC_SUCCESS: The socket has successfully disconnected.
- TTV_EC_SOCKET_ERR: A generic error occurred.
Implements ttv::IWebSocket.
◆ GetJavaInstance()
◆ Peek()
Determines the size and type of the next available message. If no messages are available then a message type of None will be returned.
- See also
- Recv
- Parameters
-
| [out] | type | The buffer to store the received bytes in. |
| [out] | length | The number of bytes actually received. |
- Returns
- TTV_EC_SUCCESS: Some bytes have been received.
- 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::IWebSocket.
◆ Recv()
| virtual TTV_ErrorCode ttv::binding::java::JavaWebSocket::Recv |
( |
MessageType & |
type, |
|
|
uint8_t * |
buffer, |
|
|
size_t |
length, |
|
|
size_t & |
received |
|
) |
| |
|
overridevirtual |
Attempts to receive a message from the web socket. The next available message will be stored in buffer provided that it is large enough to store it. Use Peek() to determine how large of a buffer to provide. If the buffer is not large enough to hold the message then an error is returned and the message is not consumed.
- See also
- Peek
- Parameters
-
| [out] | type | The buffer to store the received bytes in. |
| [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_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.
- TTV_EC_INVALID_BUFFER: The given buffer is not big enough to store the next message.
Implements ttv::IWebSocket.
◆ Send()
| virtual TTV_ErrorCode ttv::binding::java::JavaWebSocket::Send |
( |
MessageType |
type, |
|
|
const uint8_t * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
overridevirtual |
Sends a message of the given type.
- Parameters
-
| [in] | type | The type of data represented by the buffer. |
| [in] | buffer | The data to send. |
| [in] | length | The number of bytes in the buffer. |
- Returns
- TTV_EC_SUCCESS: The socket has successfully connected and is ready to exchange data.
- TTV_EC_SUCCESS: The message has 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.
Implements ttv::IWebSocket.
◆ mByteArrayInstance
◆ mByteArraySize
| size_t ttv::binding::java::JavaSocketBase::mByteArraySize |
|
protectedinherited |
The size of mByteArrayInstance.
◆ mMessageTypeResultContainer
◆ mSentReceivedResultContainer
◆ mSocketInstance
The java implementation of the socket.
The documentation for this class was generated from the following file: