Actions
Feature #798
openAdd Irccd.Socket API
Start date:
04/16/2018
Due date:
% Done:
0%
Estimated time:
8.00 h
Branch:
default
Platform:
Description
Create an asynchronous Irccd.Socket API for communicating with internet and local sockets.
Server class¶
This object only have one function for accepting clients.
Server(options)
: create a server object,Server.prototype.accept(handler)
: wait for a client and call the handler.
Socket class¶
Socket(type)
: create a socket,Socket.prototype.connect(options, handler)
: connect to the given endpoint,Socket.prototype.write(data, handler)
: write some data to the socket,Socket.prototype.read(amount, handler)
: read some data from the socket,Socket.prototype.readline(delimiter, handler)
: convenient handler that reads until a delimiter,Socket.prototype.close(handler = null)
: close gracefully the socket.
Actions