[Ndn-lib] PyNDN UdpTransport: specify local port
shijunxiao at email.arizona.edu
Sat Apr 21 15:38:22 PDT 2018
I have a suggestion for PyNDN's UdpTransport: the application should be
allowed to specify a local port number.
Use case: UdpTransport is typically used when the host running PyNDN
application does not have a forwarder. In order for the application to
serve content, it must register a prefix to receive Interests. Although the
application could send a prefix registration command to the remote
forwarder, it's not trivial to configure the keychain, and the application
would also need to periodically refresh the prefix registration. On the
other hand, when the operator has control over the remote forwarder as
well, it is much more convenient to setup a route on the forwarder toward
the application. However, this is possible only if the application's IP
address and port number are known.
1. In UdpTransport.ConnectionInfo class constructor, add a named parameter
'localPort'. Its default value is None.
2. In UdpTransport.connect method, if localPort is not None, call
3. In case bind fails, raise an exception and let the caller handle it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ndn-lib