Client(log, connectionObserver, client)

When a server needs to connect with another, a client connection needs to be esablished. This class is representing that client.

new Client(log, connectionObserver, client)

Parameters:
Name Type Description
log Logger
connectionObserver ConnectionObserver
client net.Socket

Extends

Methods

connect(port, host)

Parameters:
Name Type Description
port number an unsigned integer
host string the host address to connect to

async emit(event, data)

Parameters:
Name Type Description
event string
data *

protected logClientEvents(client, log)

Parameters:
Name Type Description
client net.Socket
log Logger

on(event, observer)

Parameters:
Name Type Description
event string
observer function
Inherited From:

once(event, observer)

Parameters:
Name Type Description
event string
observer function
Inherited From:

removeListener(event, observer)

Parameters:
Name Type Description
event string
observer function
Inherited From: