1.7.2.9
Gameface
cohtml::ISocketListener Class Reference

The ISocketListener represents cohtml::View side of the web sockets. More...

Public Member Functions

virtual ~ISocketListener ()
 
virtual void OnMessage (const char *bytes, unsigned length)
 Called when platform socket receive message new message. More...
 
virtual void OnClose (unsigned code, const char *reason, unsigned length)
 Called when platform socket want to close connection. More...
 
virtual void OnError (const char *message, unsigned length)
 Called when any error occurred. More...
 
virtual void OnOpen ()
 Called by platform socket to notify page about successfully connecction establishment. More...
 

Detailed Description

The ISocketListener represents cohtml::View side of the web sockets.

Constructor & Destructor Documentation

◆ ~ISocketListener()

virtual cohtml::ISocketListener::~ISocketListener ( )
inlinevirtual

Member Function Documentation

◆ OnClose()

virtual void cohtml::ISocketListener::OnClose ( unsigned  code,
const char *  reason,
unsigned  length 
)
inlinevirtual

Called when platform socket want to close connection.

Parameters
codeindicates 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 data

◆ OnError()

virtual void cohtml::ISocketListener::OnError ( const char *  message,
unsigned  length 
)
inlinevirtual

Called when any error occurred.

Parameters
messagethe text data which is send to the page
lengththe length in bytes of the text

◆ OnMessage()

virtual void cohtml::ISocketListener::OnMessage ( const char *  bytes,
unsigned  length 
)
inlinevirtual

Called when platform socket receive message new message.

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

◆ OnOpen()

virtual void cohtml::ISocketListener::OnOpen ( )
inlinevirtual

Called by platform socket to notify page about successfully connecction establishment.