ProtocolAddress Class | 
Namespace: Demo3D.Net
public class ProtocolAddress : Uri
The ProtocolAddress type exposes the following members.
| Name | Description | |
|---|---|---|
| ProtocolAddress(ProtocolAddress) | 
            Constructs a new protocol address using the supplied address.
              | |
| ProtocolAddress(String) | 
            Constructs a new protocol address by parsing the supplied address string.
              | 
| Name | Description | |
|---|---|---|
| BinaryParts | 
            Decodes the absolute path of the address into segments, returning them as binary data.
              | |
| HasHost | 
            Returns true if the hostname is set.
              | |
| NextProtocol | 
            The next protocol indicated by the address (second part of the scheme, if present).
              | |
| Parts | 
            Decodes the absolute path of the address into parts.
              | |
| Protocol | 
            The protocol indicated by the address (first part of the scheme).
              | |
| SchemeParts | 
            The individual parts of the scheme.
              | 
| Name | Description | |
|---|---|---|
| ToBinary | 
            Converts 8-bit unescaped ASCII string to binary data.
              | |
| ToString | 
            Converts binary data to 8-bit unescaped ASCII string.
              | 
| Name | Description | |
|---|---|---|
| (String to ProtocolAddress) | 
            Implicitly converts from string address to a ProtocolAddress.
              | 
| Name | Description | |
|---|---|---|
| AnyHost | 
            Pseudo hostname that's used to indicate a server or service running on this/any machine.
            For example, a server running on this machine and accepting connections from any client.
              | 
Based on Uri, a ProtocolAddress is a URI that points to a particular client or server. It includes all the information need to establish a connection without including any information about how the connection will be used.
An address should explicitly contain any information required to connect, but exclude any connection parameters, routing information, etc, unless required to identify the peer.
| Address | Description | 
|---|---|
| tcp://host:1234 | Where 1234 is the port number. | 
| modbus://host:1234 | |
| cotp://host/tsap | Where "tsap" is the ISO TSAP. | 
A server address would normally exclude the hostname. You would include a hostname if you wanted the server to run only on a specific network interface. Also (since a URI cannot contain a port number unless it also contains a hostname) you would use the special hostname ProtocolAddress.AnyHost ("any").
| Address | Description | 
|---|---|
| tcp://localhost:1234 | A server accepting connections only on localhost. | 
| cotp://any:1234/tsap | A server accepting COTP connections for "tsap" on port 1234 (instead of the default port 102). | 
Since protocols are stacked on top of other protocols, it can also be useful to include the full protocol path in the URI scheme. For example, Modbus is a protocol that typically uses TCP, but it's also quite common to use the Modbus protocol over UDP. And another example, Fetch/Write can run over TCP or over ISO COTP.
| Address | Description | 
|---|---|
| modbus://host:1234 | Defaults to TCP. | 
| modbus.tcp://host:1234 | Explicitly require Modbus over TCP. | 
| modbus.udp://host:1234 | Explicitly require Modbus over UDP. | 
| fetchwrite://host:1234 | Defaults to TCP. | 
| fetchwrite.cotp://host/tsap | Explicitly require COTP, and provide a TSAP instead of a port number. | 
Best practice for creating a ProtocolAddress is to use the ProtocolAddressBuilder class, and to use the built-in constants for scheme names (eg Scheme).