Class: Transport

Transport

new Transport()

Transport is a base class for specific transport classes such as TcpTransport.
Source:

Methods

(static) ConnectionInfo()

Transport.ConnectionInfo is a base class for connection information used by subclasses of Transport.
Source:

isLocal(connectionInfo, onResult, onError)

Determine whether this transport connecting according to connectionInfo is to a node on the current machine. This affects the processing of Face.registerPrefix(): if the NFD is local, registration occurs with the '/localhost/nfd...' prefix; if non-local, the library will attempt to use remote prefix registration using '/localhop/nfd...'
Parameters:
Name Type Description
connectionInfo Transport.ConnectionInfo A ConnectionInfo with the host to check.
onResult function On success, this calls onResult(isLocal) where isLocal is true if the host is local, false if not. We use callbacks because this may need to do an asynchronous DNS lookup.
onError function On failure for DNS lookup or other error, this calls onError(message) where message is an error string.
Source: