Naanou.LookupService
Class Remoting

Manages the remoting channels and port allocation

Field Summary
bool autoDetectNATGateway
System.Net.IPEndPoint listenBind
string localAddress
Naanou.Common.ILogger logger
Naanou.LookupService.Node node
int portInUse
string primaryUrl
System.Runtime.Remoting.Channels.Tcp.TcpChannel tcpChannel

Constructor Summary
Remoting(Naanou.LookupService.Node node)
         Constructor

Property Summary
bool AutodetectedNATGateway
         Was NAT gateway auto-detected?
System.Net.IPEndPoint ListenBind
         Gets the IPEndPoint channel is listening on
string LocalAddress
         Gest the local address (IP address), or gateway
string PrimaryUrl
         Primary URL for transport

Method Summary
bool PortInUse(int port)
         Checks whether a port is in use by attempting to do an exclusive bind to it
void SetLocalAddress(string newAddress)
         Overrides the local address setting
bool Start()
         Starts the transport service. Publishes node
void StartListening()
         Start listening on default ports
void StartListening(int tcpPort)
         Start listening on a specified port
void Stop()
         Close down remoting services (unpublishes node)

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

autoDetectNATGateway

private bool autoDetectNATGateway


listenBind

private System.Net.IPEndPoint listenBind


localAddress

private string localAddress


logger

private Naanou.Common.ILogger logger


node

private Naanou.LookupService.Node node


portInUse

private int portInUse


primaryUrl

private string primaryUrl


tcpChannel

private System.Runtime.Remoting.Channels.Tcp.TcpChannel tcpChannel

Constructor Detail

Remoting

public Remoting(Naanou.LookupService.Node node)

Constructor

Parameters:
node - Node
Property Detail

AutodetectedNATGateway

public bool AutodetectedNATGateway

Was NAT gateway auto-detected?


ListenBind

public System.Net.IPEndPoint ListenBind

Gets the IPEndPoint channel is listening on


LocalAddress

public string LocalAddress

Gest the local address (IP address), or gateway


PrimaryUrl

public string PrimaryUrl

Primary URL for transport

Method Detail

PortInUse

private bool PortInUse(int port)

Checks whether a port is in use by attempting to do an exclusive bind to it

Parameters:
port - Port to try
Returns:
True if port is in use

SetLocalAddress

public void SetLocalAddress(string newAddress)

Overrides the local address setting

Parameters:
newAddress - Local address (preferably IP)

Start

public bool Start()

Starts the transport service. Publishes node

Returns:
True if everything went ok, False if there was an error

StartListening

private void StartListening()

Start listening on default ports


StartListening

private void StartListening(int tcpPort)

Start listening on a specified port

Parameters:
tcpPort - Port to try

Stop

public void Stop()

Close down remoting services (unpublishes node)