Class AmqpTcpEndpoint
Represents a TCP-addressable AMQP peer: a host name and port number.
Inherited Members
Namespace: RabbitMQ.Client
Assembly: RabbitMQ.Client.dll
Syntax
public class AmqpTcpEndpoint
Constructors
| Edit this page View SourceAmqpTcpEndpoint()
Construct an AmqpTcpEndpoint with "localhost" as the hostname, and using the default port.
Declaration
public AmqpTcpEndpoint()
AmqpTcpEndpoint(string, int)
Creates a new instance of the AmqpTcpEndpoint.
Declaration
public AmqpTcpEndpoint(string hostName, int portOrMinusOne = -1)
Parameters
Type | Name | Description |
---|---|---|
string | hostName | Hostname. |
int | portOrMinusOne | Port number. If the port number is -1, the default port number will be used. |
AmqpTcpEndpoint(string, int, SslOption)
Creates a new instance of the AmqpTcpEndpoint.
Declaration
public AmqpTcpEndpoint(string hostName, int portOrMinusOne, SslOption ssl)
Parameters
Type | Name | Description |
---|---|---|
string | hostName | Hostname. |
int | portOrMinusOne | Port number. If the port number is -1, the default port number will be used. |
SslOption | ssl | Ssl option. |
AmqpTcpEndpoint(string, int, SslOption, uint)
Creates a new instance of the AmqpTcpEndpoint.
Declaration
public AmqpTcpEndpoint(string hostName, int portOrMinusOne, SslOption ssl, uint maxMessageSize)
Parameters
Type | Name | Description |
---|---|---|
string | hostName | Hostname. |
int | portOrMinusOne | Port number. If the port number is -1, the default port number will be used. |
SslOption | ssl | Ssl option. |
uint | maxMessageSize | Maximum message size from RabbitMQ. 0 means "unlimited" |
AmqpTcpEndpoint(Uri)
Creates a new instance of the AmqpTcpEndpoint with the given Uri.
Declaration
public AmqpTcpEndpoint(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri |
Remarks
Please see the class overview documentation for information about the Uri format in use.
AmqpTcpEndpoint(Uri, SslOption)
Creates a new instance of the AmqpTcpEndpoint with the given Uri and ssl options.
Declaration
public AmqpTcpEndpoint(Uri uri, SslOption ssl)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | |
SslOption | ssl |
Remarks
Please see the class overview documentation for information about the Uri format in use.
Fields
| Edit this page View SourceDefaultAmqpSslPort
Default Amqp ssl port.
Declaration
public const int DefaultAmqpSslPort = 5671
Field Value
Type | Description |
---|---|
int |
UseDefaultPort
Indicates that the default port for the protocol should be used.
Declaration
public const int UseDefaultPort = -1
Field Value
Type | Description |
---|---|
int |
Properties
| Edit this page View SourceAddressFamily
Used to force the address family of the endpoint. Use InterNetwork to force to IPv4. Use InterNetworkV6 to force to IPv6. Or use Unknown to attempt both IPv6 and IPv4.
Declaration
public AddressFamily AddressFamily { get; set; }
Property Value
Type | Description |
---|---|
AddressFamily |
HostName
Retrieve or set the hostname of this AmqpTcpEndpoint.
Declaration
public string HostName { get; set; }
Property Value
Type | Description |
---|---|
string |
MaxMessageSize
Get the maximum size for a message in bytes. The default value is 0 (unlimited)
Declaration
public uint MaxMessageSize { get; }
Property Value
Type | Description |
---|---|
uint |
Port
Retrieve or set the port number of this AmqpTcpEndpoint. A port number of -1 causes the default port number.
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
int |
Protocol
Retrieve IProtocol of this AmqpTcpEndpoint.
Declaration
public IProtocol Protocol { get; }
Property Value
Type | Description |
---|---|
IProtocol |
Ssl
Retrieve the TLS options for this AmqpTcpEndpoint. If not set, null is returned.
Declaration
public SslOption Ssl { get; set; }
Property Value
Type | Description |
---|---|
SslOption |
Methods
| Edit this page View SourceClone()
Clones the endpoint.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
object | A copy with the same hostname, port, and TLS settings |
CloneWithHostname(string)
Clones the endpoint using the provided hostname.
Declaration
public AmqpTcpEndpoint CloneWithHostname(string hostname)
Parameters
Type | Name | Description |
---|---|---|
string | hostname | Hostname to use |
Returns
Type | Description |
---|---|
AmqpTcpEndpoint | A copy with the provided hostname and port/TLS settings of this endpoint |
Equals(object)
Compares this instance by value (protocol, hostname, port) against another instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetHashCode()
Implementation of hash code depending on protocol, hostname and port, to line up with the implementation of Equals(object).
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceParse(string)
Construct an instance from a protocol and an address in "hostname:port" format.
Declaration
public static AmqpTcpEndpoint Parse(string address)
Parameters
Type | Name | Description |
---|---|---|
string | address |
Returns
Type | Description |
---|---|
AmqpTcpEndpoint |
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(string)
Splits the passed-in string on ",", and passes the substrings to Parse(string).
Declaration
public static AmqpTcpEndpoint[] ParseMultiple(string addresses)
Parameters
Type | Name | Description |
---|---|---|
string | addresses |
Returns
Type | Description |
---|---|
AmqpTcpEndpoint[] |
Remarks
Accepts a string of the form "hostname:port, hostname:port, ...", where the ":port" pieces are optional, and returns a corresponding array of AmqpTcpEndpoints.
ToString()
Returns a URI-like string of the form amqp-PROTOCOL://HOSTNAME:PORTNUMBER.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Remarks
This method is intended mainly for debugging and logging use.