C# Class bedrock.net.Address

Show file Open project: codebutler/jabber-net Class Usage Examples

Public Methods

Method Description
Address ( IPAddress ip, int port ) : System

Create a new connection endpoint, where the IP address is already known.

Address ( int port ) : System

Address for a server, corresponding to IPAddress.Any.

Address ( string hostname, int port ) : System

New connection endpoint.

LookupSRV ( string prefix, string domain, string &host, int &port ) : void

Look up a DNS SRV record, returning the best host and port number to connect to.

LookupTXT ( string prefix, string domain, string attribute ) : string

Look up a DNS TXT record.

Resolve ( ) : void

Synchronous DNS lookup.

Resolve ( AddressResolved callback ) : void

Async DNS lookup. IP will be null in callback on failure. Callback will be called immediately if IP is already known (e.g. dotted-quad).

ToString ( ) : string

Readable representation of the address. Host (IP):port

Private Methods

Method Description
OnResolved ( IAsyncResult ar ) : void

Handle the async DNS response.

PickSRV ( SRVRecord srv ) : SRVRecord

Method Details

Address() public method

Create a new connection endpoint, where the IP address is already known.
public Address ( IPAddress ip, int port ) : System
ip System.Net.IPAddress
port int
return System

Address() public method

Address for a server, corresponding to IPAddress.Any.
public Address ( int port ) : System
port int
return System

Address() public method

New connection endpoint.
public Address ( string hostname, int port ) : System
hostname string Host name or dotted-quad IP address
port int Port number
return System

LookupSRV() public static method

Look up a DNS SRV record, returning the best host and port number to connect to.
public static LookupSRV ( string prefix, string domain, string &host, int &port ) : void
prefix string The SRV prefix, ending with a dot. Example: "_xmpp-client._tcp."
domain string The domain to check
host string The host name to connect to
port int The port number to connect to
return void

LookupTXT() public static method

Look up a DNS TXT record.
public static LookupTXT ( string prefix, string domain, string attribute ) : string
prefix string The prefix, ending in '.'. Example: "_xmppconnect."
domain string The domain to search
attribute string The attribute name to look for. Example: "_xmpp-client-xbosh"
return string

Resolve() public method

Synchronous DNS lookup.
public Resolve ( ) : void
return void

Resolve() public method

Async DNS lookup. IP will be null in callback on failure. Callback will be called immediately if IP is already known (e.g. dotted-quad).
public Resolve ( AddressResolved callback ) : void
callback AddressResolved Called when resolution complete.
return void

ToString() public method

Readable representation of the address. Host (IP):port
public ToString ( ) : string
return string