1.7.2.9
Gameface
cohtml::IClientSideSocket Class Reference

The IClientSideSocket represents platform/client specific part of the web sockets. More...

Public Member Functions

virtual ~IClientSideSocket ()
 
virtual void Send (const char *bytes, unsigned length)
 Called when the JS web socket want to send 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...
 

Detailed Description

The IClientSideSocket represents platform/client specific part of the web sockets.

Constructor & Destructor Documentation

◆ ~IClientSideSocket()

virtual cohtml::IClientSideSocket::~IClientSideSocket ( )
inlinevirtual

Member Function Documentation

◆ 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
codeindicate the status code explaining why the connection is being closed
reasona human-readable string explaining why the connection is closing
lengththe 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()

virtual void cohtml::IClientSideSocket::Send ( const char *  bytes,
unsigned  length 
)
inlinevirtual

Called when the JS web socket want to send data to the server.

Parameters
bytesthe binary or text data which is send to the server
lengththe length in bytes of the data

◆ 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
codeindicate the status code explaining why the connection is being closed
reasona human-readable string explaining why the connection is closing
lengththe length in bytes of the reason