The IClientSideSocket represents platform/client specific part of the web sockets.
More...
|
| IClientSideSocket () |
|
virtual | ~IClientSideSocket () |
|
virtual void | Send (const char *bytes, unsigned length) |
| Called when the JS web socket want to send text data to the server. More...
|
|
virtual void | Send (const char *bytes, unsigned length, cohtml::websocket::OpCode opCode) |
| Called when the JS web socket want to send binary or text data to the server. More...
|
|
virtual unsigned | GetBufferedAmount () |
| Called when the JS web socket want to get buffered amount of data. More...
|
|
virtual const char * | GetProtocol () |
| Called when the JS web socket want to name of the sub-protocol the server selected. More...
|
|
virtual void | Close (unsigned code, const char *reason, unsigned length) |
| Called when the JS web socket want to close the connection with server. More...
|
|
virtual void | Terminate (unsigned code, const char *reason, unsigned length) |
| Called when the JS web socket will no longer will call IClientSideSocket and now is safe to destroy this object. The method must close the connection to the server and also it's no longer safe to use a. More...
|
|
The IClientSideSocket represents platform/client specific part of the web sockets.
◆ IClientSideSocket()
cohtml::IClientSideSocket::IClientSideSocket |
( |
| ) |
|
◆ ~IClientSideSocket()
virtual cohtml::IClientSideSocket::~IClientSideSocket |
( |
| ) |
|
|
virtual |
◆ Close()
virtual void cohtml::IClientSideSocket::Close |
( |
unsigned |
code, |
|
|
const char * |
reason, |
|
|
unsigned |
length |
|
) |
| |
|
inlinevirtual |
Called when the JS web socket want to close the connection with server.
- Parameters
-
code | indicate the status code explaining why the connection is being closed |
reason | a human-readable string explaining why the connection is closing |
length | the length in bytes of the reason |
◆ GetBufferedAmount()
virtual unsigned cohtml::IClientSideSocket::GetBufferedAmount |
( |
| ) |
|
|
inlinevirtual |
Called when the JS web socket want to get buffered amount of data.
- Returns
- the number of bytes of data that have been queued using calls to IClientSideSocket::Send()
◆ GetProtocol()
virtual const char* cohtml::IClientSideSocket::GetProtocol |
( |
| ) |
|
|
inlinevirtual |
Called when the JS web socket want to name of the sub-protocol the server selected.
- Returns
- selected sub-protocol
◆ Send() [1/2]
virtual void cohtml::IClientSideSocket::Send |
( |
const char * |
bytes, |
|
|
unsigned |
length |
|
) |
| |
|
inlinevirtual |
Called when the JS web socket want to send text data to the server.
- Parameters
-
bytes | text data which is send to the server |
length | the length in bytes of the data |
- Warning
- Will be deprecated, implement IClientSideSocket::Send/3 instead.
◆ Send() [2/2]
Called when the JS web socket want to send binary or text data to the server.
- Parameters
-
bytes | the binary or text data which is send to the server |
length | the length in bytes of the data |
opCode | desired opcode of a WebSocket message to be sent |
◆ Terminate()
virtual void cohtml::IClientSideSocket::Terminate |
( |
unsigned |
code, |
|
|
const char * |
reason, |
|
|
unsigned |
length |
|
) |
| |
|
inlinevirtual |
Called when the JS web socket will no longer will call IClientSideSocket and now is safe to destroy this object. The method must close the connection to the server and also it's no longer safe to use a.
- Parameters
-
code | indicate the status code explaining why the connection is being closed |
reason | a human-readable string explaining why the connection is closing |
length | the length in bytes of the reason |