FCohtmlWebSocketWrapper

Inherits from IClientSideSocket

Public Functions

Name
FCohtmlWebSocketWrapper(cohtml::ISocketListener * InListener, const char * url, const char ** protocols, unsigned protocolsCount)
virtual voidSend(const char * bytes, unsigned length) override
Called when the JS web socket want to send data to the server.
virtual unsignedGetBufferedAmount()
Called when the JS web socket want to get buffered amount of data.
virtual const char *GetProtocol()
Called when the JS web socket want to name of the sub-protocol the server selected.
virtual voidClose(unsigned code, const char * reason, unsigned length)
Called when the JS web socket want to close the connection with server.
virtual voidTerminate(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.
voidHandleUE4WebSocketConnected()
voidHandleUE4WebSocketConnectionError(const FString & Error)
voidHandleUE4WebSocketConnectionClosed(int32 Status, const FString & Reason, bool bWasClean)
voidHandleUE4WebSocketData(const void * Data, SIZE_T Length, SIZE_T BytesRemaining)

Public Functions Documentation

function FCohtmlWebSocketWrapper

inline FCohtmlWebSocketWrapper(
    cohtml::ISocketListener * InListener,
    const char * url,
    const char ** protocols,
    unsigned protocolsCount
)

function Send

inline virtual void Send(
    const char * bytes,
    unsigned length
) override

Called when the JS web socket want to send 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

function GetBufferedAmount

inline virtual unsigned GetBufferedAmount()

Called when the JS web socket want to get buffered amount of data.

Return: the number of bytes of data that have been queued using calls to IClientSideSocket::Send() Messages are are not buffered for this implementation, so this is always 0

function GetProtocol

inline virtual const char * GetProtocol()

Called when the JS web socket want to name of the sub-protocol the server selected.

Return: selected sub-protocol Not implemented, since the UE4 API does not allow getting the protocol

function Close

inline virtual void Close(
    unsigned code,
    const char * reason,
    unsigned length
)

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

function Terminate

inline 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.

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

function HandleUE4WebSocketConnected

inline void HandleUE4WebSocketConnected()

function HandleUE4WebSocketConnectionError

inline void HandleUE4WebSocketConnectionError(
    const FString & Error
)

function HandleUE4WebSocketConnectionClosed

inline void HandleUE4WebSocketConnectionClosed(
    int32 Status,
    const FString & Reason,
    bool bWasClean
)

function HandleUE4WebSocketData

inline void HandleUE4WebSocketData(
    const void * Data,
    SIZE_T Length,
    SIZE_T BytesRemaining
)