Skip to content

net

Object: jstp.net

jstp.net.connect(app, client, ...args, callback)

jstp.net.connectAndInspect(app, client, interfaces, ...args, callback)

Connects to the server and sends 'inspect' messages for the requested interfaces. In case all of the inspect calls were successful, an object containing remote proxies is returned.

It is possible, when using this method, to get an error jstp.ERR_INTERFACE_NOT_FOUND passed to the callback due to some of the 'inspect' calls failing, and still receive a usable connection object.

jstp.net.reconnect(connection, ...args, callback)

This method can be used to reconnect to the same session without switching to the new Connection instance.

At the moment, when using this on a still alive connection, server implementation provided by this package closes the previous network connection on its side, but in general, it is not recommended to use this method on such connections, since there is no guarantee that the server will close the already existing network connection during reconnection and thus it may result in a dangling network connection.

jstp.net.createServer(options[, listener])

For additional options see documentation for net.createServer(). However, beware, some of the options may interfere with the correct functioning of the JSTP protocol.

authPolicy is used whenever the handshake with authentication strategy other than 'anonymous' or 'session' is received. In case it is omitted from the options, using any other strategy will result in jstp.ERR_AUTH_FAILED error.