Click or drag to resize

ProtocolAddressBuilder Class

A class for constructing protocol addresses.
Inheritance Hierarchy
SystemObject
  Demo3D.NetProtocolAddressBuilder

Namespace:  Demo3D.Net
Assembly:  Demo3D.IO (in Demo3D.IO.dll) Version: 18.03.00
Syntax
C#
public class ProtocolAddressBuilder

The ProtocolAddressBuilder type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCode exampleAddress
Returns the address constructed by this builder.
Public propertyBinaryParts
Gets of sets the parts of the address path as binary data.
Public propertyHost
Gets or sets the host name of the address.
Public propertyParts
Gets or sets the parts of the address Path.
Public propertyPort
Gets or sets the port number of the address.
Public propertyScheme
Gets or sets the scheme of the address.
Top
Remarks

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.

Examples
The following examples show how to create a ProtocolAddress for different protocols.
C#
// 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);
See Also