Class TransportUtils
Inheritance
Inherited Members
Namespace: FixAntenna.FixEngine.Transport.Utils
Assembly: FixAntenna.Core.dll
Syntax
public static class TransportUtils
Methods
AsString(EndPoint)
Returns string representation of System.Net.EndPoint in format [hostname|IP]:port. Correctly handles IPv4 mapped to IPv6 System.Net.IPAddress in case of System.Net.IPEndPoint. Returns System.Net.DnsEndPoint.Host property in case of System.Net.DnsEndPoint.
Declaration
public static string AsString(this EndPoint ep)
Parameters
Type | Name | Description |
---|---|---|
System.Net.EndPoint | ep | EndPoint |
Returns
Type | Description |
---|---|
System.String | String representation of System.Net.IPEndPoint.Address for System.Net.IPEndPoint or System.Net.DnsEndPoint.Host for System.Net.DnsEndPoint. |
AsString(IPAddress)
Returns string representation of System.Net.IPAddress. If address is mapped to IPv6 (has form like ::ffff:127.0.0.1) maps it back to IPv4.
Declaration
public static string AsString(this IPAddress address)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPAddress | address | Address |
Returns
Type | Description |
---|---|
System.String | String representation of System.Net.IPAddress. |
ToEndPoint(String, Int32)
Parses input string as IP address and returns IPEndPoint if succeed. Otherwise, returns DnsEndPoint.
Declaration
public static EndPoint ToEndPoint(this string address, int port)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | IP address or host name. |
System.Int32 | port | Port to use in EndPoint ctor. |
Returns
Type | Description |
---|---|
System.Net.EndPoint | Returns System.Net.EndPoint initialized with provided address and port. |