C# 클래스 Brunet.Messaging.IPHandler

IPHandler is provided to do BrunetRpc natively (as opposed to XmlRpc). This service provides for discovery similar to zeroconf. This was done due to zeroconf not being widespread enough to rely on it as well as too many ways to interface with the different implementations. Discovery runs at group address 224.123.123.222:56123.
상속: SimpleSource
파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
MagicCookie Brunet.Util.MemBlock
mc_addr System.Net.IPAddress
mc_endpoint System.Net.EndPoint
mc_port int

보호된 프로퍼티들

프로퍼티 타입 설명
_listen_thread Thread
_mc Socket
_running int
_uc Socket

공개 메소드들

메소드 설명
CreateMulticastSender ( ) : ISender

Creates a new MulticastSender using the IPHandlers multicastcast socket. This sends to all network devices on the computer.

CreateMulticastSender ( IPAddress LocalIPAddresses ) : ISender

Creates a Multicast Sender using the unicast socket, so that other nodes know where they can reach us. Only sends to the addresses in the array.

CreateUnicastSender ( EndPoint ep ) : ISender

Creates a new UnicastSender using the IPHandlers unicast socket.

GetLocalIPAddresses ( ) : System.Net.IPAddress[]

Returns an array of all the IPAddresses of the local machine. Manually add loopback sense Windows does not have a loopback interface.

IPAddressToInt ( IPAddress addr ) : int

IPAddress.Address is obsolete, we use our own method to convert to an int in case the method is removed.

IPHandler ( ) : System

Creates a new IPHandler object by initializing the multicast and unicast socket.

The multicast socket is optional as nodes can discover other working nodes using only the unicast socket. The steps for setup for a multicast socket are bind to 0.0.0.0:port, add membership to all IP Addresses on the node, allow MulticastLoopback. The steps for the unicast socket are to create socket andbind to 0.0.0.0 and random port. Afterwhich the _listen_thread is started in the background.

Stop ( ) : void

Called to interrupt the _listen_thread.

보호된 메소드들

메소드 설명
Listen ( ) : void

The _listen_threads method, reads from sockets and let's the node handle the incoming data.

메소드 상세

CreateMulticastSender() 공개 메소드

Creates a new MulticastSender using the IPHandlers multicastcast socket. This sends to all network devices on the computer.
public CreateMulticastSender ( ) : ISender
리턴 ISender

CreateMulticastSender() 공개 메소드

Creates a Multicast Sender using the unicast socket, so that other nodes know where they can reach us. Only sends to the addresses in the array.
public CreateMulticastSender ( IPAddress LocalIPAddresses ) : ISender
LocalIPAddresses System.Net.IPAddress The local ip addresses we should send on.
리턴 ISender

CreateUnicastSender() 공개 메소드

Creates a new UnicastSender using the IPHandlers unicast socket.
public CreateUnicastSender ( EndPoint ep ) : ISender
ep System.Net.EndPoint The remote network end point where the UnicastSender should send the data.
리턴 ISender

GetLocalIPAddresses() 공개 정적인 메소드

Returns an array of all the IPAddresses of the local machine. Manually add loopback sense Windows does not have a loopback interface.
public static GetLocalIPAddresses ( ) : System.Net.IPAddress[]
리턴 System.Net.IPAddress[]

IPAddressToInt() 공개 정적인 메소드

IPAddress.Address is obsolete, we use our own method to convert to an int in case the method is removed.
When not an IPv4 address.
public static IPAddressToInt ( IPAddress addr ) : int
addr System.Net.IPAddress The address to convert to an integer.
리턴 int

IPHandler() 공개 메소드

Creates a new IPHandler object by initializing the multicast and unicast socket.
The multicast socket is optional as nodes can discover other working nodes using only the unicast socket. The steps for setup for a multicast socket are bind to 0.0.0.0:port, add membership to all IP Addresses on the node, allow MulticastLoopback. The steps for the unicast socket are to create socket andbind to 0.0.0.0 and random port. Afterwhich the _listen_thread is started in the background.
public IPHandler ( ) : System
리턴 System

Listen() 보호된 메소드

The _listen_threads method, reads from sockets and let's the node handle the incoming data.
protected Listen ( ) : void
리턴 void

Stop() 공개 메소드

Called to interrupt the _listen_thread.
public Stop ( ) : void
리턴 void

프로퍼티 상세

MagicCookie 공개적으로 정적으로 프로퍼티

public static MemBlock,Brunet.Util MagicCookie
리턴 Brunet.Util.MemBlock

_listen_thread 보호되어 있는 프로퍼티

Thread dedicated to reading from the unicast and multicast sockets
protected Thread _listen_thread
리턴 Thread

_mc 보호되어 있는 프로퍼티

Runs on 224.123.123.222:56123
protected Socket _mc
리턴 Socket

_running 보호되어 있는 프로퍼티

The system is running and so should _listen_thread.
protected int _running
리턴 int

_uc 보호되어 있는 프로퍼티

The unicast socket, the port is randomly selected.
protected Socket _uc
리턴 Socket

mc_addr 공개적으로 정적으로 프로퍼티

Multicast address.
public static IPAddress,System.Net mc_addr
리턴 System.Net.IPAddress

mc_endpoint 공개적으로 정적으로 프로퍼티

Multicast end point.
public static EndPoint,System.Net mc_endpoint
리턴 System.Net.EndPoint

mc_port 공개적으로 정적으로 프로퍼티

Multicast port.
public static int mc_port
리턴 int