Skip to content
Thomas Cherryhomes edited this page May 9, 2020 · 2 revisions

The N: Device spec consists of an RFC compliant URL, which encodes:

  • Protocol Scheme
  • Host
  • Port # (optional)
  • Path to some resource e.g. file (optional)
  • Any URL encoded query parameters (e.g. for HTTP)

TCP

TCP Connections can be made to any host or port.

Client connections

N:TCP://192.168.1.2:2000/

Connects to the host at 192.168.1.2 port 2000.

Server connections

N:TCP://:2000/

Opens a listening connection on port 2000 of the ESP, which someone else can connect to. Once a client is connected, the connection should be accepted, so that it can be used for I/O.

UDP

UDP protocol works similarly, except that there is no actual connection. Setting a hostname merely specifies where the next packets written will be sent. The Port number is required, and specifies not only the destination port for UDP packets, but also the listening ports for UDP packets to be received.

N:UDP://bob.foo.com:2000/

Indicates that UDP packets should be sent to the hostname bob.foo.com port 2000.

While,

N:UDP://:2000/

Indicates that there is no default destination address to start with, but to listen for UDP packets on port 2000.

Once a packet is received, the destination address is sent to the remote address and port of the packet received, so that the next write will reply back to it, as a convenience.

HTTP/HTTPS

HTTP and HTTPS connections can be made to specific URLs. e.g.

N:HTTP://WWW.GOOGLE.COM/
N:HTTPS://WWW.TWITTER.COM/

Clone this wiki locally