Protocol |
public class ProtocolAddressBuilder
The ProtocolAddressBuilder type exposes the following members.
| Name | Description | |
|---|---|---|
| ProtocolAddressBuilder | Constructs a new protocol address builder. | |
| ProtocolAddressBuilder(ProtocolAddress) | Constructs a new protocol address builder with the specified URI. | |
| ProtocolAddressBuilder(String, String) | Constructs a new protocol address builder with the specified scheme and host. | |
| ProtocolAddressBuilder(String, String, Int32) | Constructs a new protocol address builder with the specified scheme, host and port. | |
| ProtocolAddressBuilder(String, String, Int32, Byte) | Constructs a new protocol address builder with the specified scheme, host, port, and path. | |
| ProtocolAddressBuilder(String, String, Int32, String) | Constructs a new protocol address builder with the specified scheme, host, port, and path. |
| Name | Description | |
|---|---|---|
| Address | Returns the address constructed by this builder. | |
| BinaryParts | Gets of sets the parts of the address path as binary data. | |
| Host | Gets or sets the host name of the address. | |
| Parts | Gets or sets the parts of the address Path. | |
| Port | Gets or sets the port number of the address. | |
| Scheme | Gets or sets the scheme of the address. |
A ProtocolAddress is a Uri pointing to a particular client or server. It allows the entire address to be represented in a single string. The string can be entered manually, or programmatically using this class.
The special hostname "any" is used to indicate any host. It's only used when a hostname is not needed but is required to create a valid URI. For example a server that accepts connections from any client running on a specified port number.
// Returns "tcp://host:port/". var tcpClientAddress = new ProtocolAddressBuilder(TCP.Scheme, host, port).Address; // Alternatively var builder = new ProtocolAddressBuilder() { Scheme = TCP.Scheme, Host = host, Port = port }; var tcpClientAddress2 = builder.Address; // Returns "tcp://any:port/". // The hostname "any" is a special hostname for servers accepting connections on all interface cards. var tcpServerAddress = new ProtocolAddressBuilder(TCP.Scheme, null, port).Address; // Returns "cotp://host/tsap". var cotpClientAddress = new ProtocolAddressBuilder(COTP.Scheme, host, -1, tsap).Address; // Construct a modbus address. var modbusAddress = new ProtocolAddressBuilder("modbus", host, -1);