Type of features provided for remote system.
Initializer Constructor.
An object providing features for remote system.
Close connection.
Close connection with the remote websocket system.
It destories all RFCs (remote function calls) between this and remote websocket system
(through Driver<Controller>
) that are not returned (completed) yet. The destruction
causes all incompleted RFCs to throw exceptions.
If parametric code and reason are specified, it means the disconnection is
abnormal and it would throw special exceptions (WebError
) to the incompleted RFCs.
Connect to remote websocket server.
Try connection to the remote websocket server with its address and waiting for the
server to accept the trial. If the server rejects your connection, then exception
would be thrown (in Promise.catch, as WebError
).
After the connection and your business has been completed, don't forget to closing the connection in time to prevent waste of the server resource.
URL address to connect.
Protocols to use.
Destory the communicator.
A destory function must be called when the network communication has been closed.
It would destroy all function calls in the remote system (by Driver<Controller>
),
which are not returned yet.
The error instance would be thrown to those function calls. If the disconnection is abnormal, then write the detailed reason why into the error instance.
An error instance to be thrown to the unreturned functions.
Get Driver for RFC (Remote Function Call).
The Controller
is an interface who defines provided functions from the remote
system. The Driver
is an object who makes to call remote functions, defined in
the Controller
and provided by Provider
in the remote system, possible.
In other words, calling a functions in the Driver<Controller>
, it means to call
a matched function in the remote system's Provider
object.
Controller
: Definition onlyDriver
: Remote Function CallAn interface for provided features (functions & objects) from the remote system (Provider
).
Whether to convert type of function parameters to be compatible with their pritimive.
A Driver for the RFC.
Get current Provider
.
Get an object providing features (functions & objects) for remote system. The remote
system would call the features (Provider
) by using its Driver<Controller>
.
Current Provider
object
Join connection.
Join connection or timeout.
The maximum milliseconds for joining.
Whether awaken by disconnection or timeout.
Join connection or time expiration.
The maximum time point to join.
Whether awaken by disconnection or time expiration.
Data Reply Function.
A function should be called when data has come from the remote system.
When you receive a message from the remote system, then parse the message with your special protocol and covert it to be an Invoke object. After the conversion, call this method.
Structured data converted by your special protocol.
Set Provider
An object would be provided for remote system.
Generated using TypeDoc
Web Socket Connector.
The
WebConnector
is a communicator class who can connect to websocket server and interact with it using RFC (Remote Function Call).You can connect to the websocket server using connect() method. The interaction would be started if the server is opened by WebServer.open() and the server accepts your connection by WebAcceptor.accept().
Note that, after you business has been completed, please close the connection using close() or let the server to close itself. If you don't close the connection in time, it may waste vulnerable resources of the server.
Jeongho Nam http://samchon.org