SockIt
|
#include <Client.h>
Public Member Functions | |
Client () | |
virtual | ~Client () |
virtual void | send (const string &data)=0 |
virtual void | send_bytes (const vector< byte > &bytes)=0 |
virtual string | get_host ()=0 |
virtual int | get_port ()=0 |
FB_JSAPI_EVENT (resolve, 0,()) |
An abstract interface for a client object. This registers the generic client-specific events to javascript, and registers the 'send' method to the javascript API.
Client::Client | ( | ) |
Constructs a default client object by registering the 'send' method for this client to the javascript.
Definition at line 10 of file Client.cpp.
References get_host(), get_port(), send(), and send_bytes().
{ registerMethod("send", make_method(this, &Client::send)); registerMethod("sendBytes", make_method(this, &Client::send_bytes)); registerMethod("getHost", make_method(this, &Client::get_host)); registerMethod("getPort", make_method(this, &Client::get_port)); }
virtual Client::~Client | ( | ) | [inline, virtual] |
Client::FB_JSAPI_EVENT | ( | resolve | , |
0 | , | ||
() | |||
) |
A javascript event to be fired when the client has successfully resolved the remote host name and is prepared to send data to the remote host.
virtual string Client::get_host | ( | ) | [pure virtual] |
virtual int Client::get_port | ( | ) | [pure virtual] |
virtual void Client::send | ( | const string & | data | ) | [pure virtual] |
virtual void Client::send_bytes | ( | const vector< byte > & | bytes | ) | [pure virtual] |