public class AmqpTcpEndpoint

Summary

Represents a TCP-addressable AMQP peer: a host name and port number.

Para

Some of the constructors take, as a convenience, a System.Uri instance representing an AMQP server address. The use of Uri here is not standardised - Uri is simply a convenient container for internet-address-like components. In particular, the Uri "Scheme" property is ignored: only the "Host" and "Port" properties are extracted.

Field Summary

Flags Type Name Summary
public const int DefaultAmqpSslPort

Default Amqp ssl port.

public const int UseDefaultPort

Indicates that the default port for the protocol should be used.

Property Summary

Flags Type Name Summary
public string HostName (rw)

Retrieve or set the hostname of this .

public int Port (rw)

Retrieve or set the port number of this AmqpTcpEndpoint. A port number of -1 causes the default port number.

public IProtocol Protocol (r)

Retrieve IProtocol of this .

public SslOption Ssl (rw)

Retrieve the SSL options for this AmqpTcpEndpoint. If not set, null is returned.

Constructor Summary

Flags Name Summary
public AmqpTcpEndpoint(string hostName, int portOrMinusOne, SslOption ssl)

Creates a new instance of the .

public AmqpTcpEndpoint(string hostName, int portOrMinusOne)

Creates a new instance of the .

public AmqpTcpEndpoint()

Construct an AmqpTcpEndpoint with "localhost" as the hostname, and using the default port.

public AmqpTcpEndpoint(Uri uri, SslOption ssl)

Creates a new instance of the with the given Uri and ssl options.

public AmqpTcpEndpoint(Uri uri)

Creates a new instance of the with the given Uri.

Method Summary

Flags Name Summary
public virtual bool Equals(object obj)

Compares this instance by value (protocol, hostname, port) against another instance.

public virtual int GetHashCode()

Implementation of hash code depending on protocol, hostname and port, to line up with the implementation of .

public static AmqpTcpEndpoint Parse(string address)

Construct an instance from a protocol and an address in "hostname:port" format.

public static AmqpTcpEndpoint[] ParseMultiple(string addresses)

Splits the passed-in string on ",", and passes the substrings to .

public virtual string ToString()

Returns a URI-like string of the form amqp-PROTOCOL://HOSTNAME:PORTNUMBER.

Field Detail

public const int DefaultAmqpSslPort

Summary

Default Amqp ssl port.

public const int UseDefaultPort

Summary

Indicates that the default port for the protocol should be used.

Property Detail

public string HostName (rw)

Summary

Retrieve or set the hostname of this .

public int Port (rw)

Summary

Retrieve or set the port number of this AmqpTcpEndpoint. A port number of -1 causes the default port number.

public IProtocol Protocol (r)

Summary

Retrieve IProtocol of this .

public SslOption Ssl (rw)

Summary

Retrieve the SSL options for this AmqpTcpEndpoint. If not set, null is returned.

Constructor Detail

AmqpTcpEndpoint

public AmqpTcpEndpoint(string hostName, int portOrMinusOne, SslOption ssl)

Parameters
Name Type
hostName string
portOrMinusOne int
ssl SslOption

Summary

Creates a new instance of the .

Param

Hostname.

Param

Port number. If the port number is -1, the default port number will be used.

Param

Ssl option.

AmqpTcpEndpoint

public AmqpTcpEndpoint(string hostName, int portOrMinusOne)

Parameters
Name Type
hostName string
portOrMinusOne int

Summary

Creates a new instance of the .

Param

Hostname.

Param

Port number. If the port number is -1, the default port number will be used.

AmqpTcpEndpoint

public AmqpTcpEndpoint()

Summary

Construct an AmqpTcpEndpoint with "localhost" as the hostname, and using the default port.

AmqpTcpEndpoint

public AmqpTcpEndpoint(Uri uri, SslOption ssl)

Parameters
Name Type
uri Uri
ssl SslOption

Summary

Creates a new instance of the with the given Uri and ssl options.

Remarks

Please see the class overview documentation for information about the Uri format in use.

AmqpTcpEndpoint

public AmqpTcpEndpoint(Uri uri)

Parameters
Name Type
uri Uri

Summary

Creates a new instance of the with the given Uri.

Remarks

Please see the class overview documentation for information about the Uri format in use.

Method Detail

Equals

public virtual bool Equals(object obj)

Flags public virtual
Return type bool
Parameters
Name Type
obj object

Summary

Compares this instance by value (protocol, hostname, port) against another instance.

GetHashCode

public virtual int GetHashCode()

Flags public virtual
Return type int

Summary

Implementation of hash code depending on protocol, hostname and port, to line up with the implementation of .

Parse

public static AmqpTcpEndpoint Parse(string address)

Flags public static
Return type AmqpTcpEndpoint
Parameters
Name Type
address string

Summary

Construct an instance from a protocol and an address in "hostname:port" format.

Remarks

If the address string passed in contains ":", it is split into a hostname and a port-number part. Otherwise, the entire string is used as the hostname, and the port-number is set to -1 (meaning the default number for the protocol variant specified). Hostnames provided as IPv6 must appear in square brackets ([]).

ParseMultiple

public static AmqpTcpEndpoint[] ParseMultiple(string addresses)

Flags public static
Return type AmqpTcpEndpoint[]
Parameters
Name Type
addresses string

Summary

Splits the passed-in string on ",", and passes the substrings to .

Remarks

Accepts a string of the form "hostname:port, hostname:port, ...", where the ":port" pieces are optional, and returns a corresponding array of s.

ToString

public virtual string ToString()

Flags public virtual
Return type string

Summary

Returns a URI-like string of the form amqp-PROTOCOL://HOSTNAME:PORTNUMBER.

Remarks

This method is intended mainly for debugging and logging use.