Interface: ISocket

Represents a client socket in the server side
When a new client is connected, a socket is instantiated in the server side allowing the server to exchange data with that client
In most use cases you don't need to handle this socket directly
but if you want to implement your own protocole on top of eureca.io you can use this interface to handle raw data.

Examples

// 

Server side

var server = new Eureca.Server(); server.on('connect', function(socket) { socket.send('my raw data'); });
// 

Client side

var client = new Eureca.Client(); // See @[ unhandledMessage event ] client.on('unhandledMessage', function (data) { console.log(data); // prints : "my raw data" });

Methods

send(rawData)

Send user data to the client bound to this socket

Parameters:
Name Type Description
rawData any

data to send (must be serializable type)