C# Класс NetworkCommsDotNet.Tools.PeerDiscovery

Provides the ability to discover 'discoverable' peers on the local network.
Показать файл Открыть проект

Открытые методы

Метод Описание
DisableDiscoverable ( ) : void

Disable this peers discoverable status for all discovery methods.

DisableDiscoverable ( DiscoveryMethod discoveryMethod ) : void

Disable this peers discoverable status for the provided DiscoveryMethod.

DiscoverPeers ( DiscoveryMethod discoveryMethod ) : Dictionary>>

Discover local peers using the provided DiscoveryMethod and default discover time. Returns dictionary keyed on peer network identifier. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.

DiscoverPeers ( DiscoveryMethod discoveryMethod, int discoverTimeMS ) : Dictionary>>

Discover local peers using the provided DiscoveryMethod. Returns dictionary keyed on peer network identifier. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.

DiscoverPeersAsync ( DiscoveryMethod discoveryMethod ) : void

Discover local peers using the provided DiscoveryMethod asynchronously. Makes a single async request for peers to announce. Ensure that you append to the OnPeerDiscovered event to handle discovered peers. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.

EnableDiscoverable ( DiscoveryMethod discoveryMethod ) : void

Make this peer discoverable using the provided DiscoveryMethod. Uses all suitable and allowed adaptors, e.g. for IP networks uses HostInfo.IP.FilteredLocalAddresses(). IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.

EnableDiscoverable ( DiscoveryMethod discoveryMethod, EndPoint localDiscoveryEndPoint ) : void

Make this peer discoverable using the provided DiscoveryMethod. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.

IsDiscoverable ( DiscoveryMethod discoveryMethod ) : bool

Returns true if local discovery endPoints exist for the provided DiscoveryMethod.

LocalDiscoveryEndPoints ( ) : List>.Dictionary

Returns the local endpoints that are currently used to make this peer discoverable.

LocalDiscoveryEndPoints ( DiscoveryMethod discoveryMethod ) : List

Returns the local endpoints that are currently used to make this peer discoverable using the provided DiscoveryMethod.

Приватные методы

Метод Описание
DeserializeRemoteListenerList ( byte data, ShortGuid &networkIdentifier ) : List

Deserializes remote listeners that are discoverable

DiscoverPeersBT ( int discoverTimeout ) : Dictionary>>

Discover peers using BT SDP

DiscoverPeersTCP ( int discoverTimeMS ) : Dictionary>>

Discover peers using TCP port scan

DiscoverPeersUDP ( int discoverTimeMS ) : Dictionary>>

Discover peers using UDP broadcast

PeerDiscovery ( ) : System
PeerDiscoveryHandler ( PacketHeader header, Connection connection, byte data ) : void

Handle the incoming peer discovery packet

SerializeLocalListenerList ( ) : byte[]

Serializes the local listeners that are discoverable

Описание методов

DisableDiscoverable() публичный статический Метод

Disable this peers discoverable status for all discovery methods.
public static DisableDiscoverable ( ) : void
Результат void

DisableDiscoverable() публичный статический Метод

Disable this peers discoverable status for the provided DiscoveryMethod.
public static DisableDiscoverable ( DiscoveryMethod discoveryMethod ) : void
discoveryMethod DiscoveryMethod The to disable discovery for.
Результат void

DiscoverPeers() публичный статический Метод

Discover local peers using the provided DiscoveryMethod and default discover time. Returns dictionary keyed on peer network identifier. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.
public static DiscoverPeers ( DiscoveryMethod discoveryMethod ) : Dictionary>>
discoveryMethod DiscoveryMethod The to use for discovering peers.
Результат Dictionary>>

DiscoverPeers() публичный статический Метод

Discover local peers using the provided DiscoveryMethod. Returns dictionary keyed on peer network identifier. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.
public static DiscoverPeers ( DiscoveryMethod discoveryMethod, int discoverTimeMS ) : Dictionary>>
discoveryMethod DiscoveryMethod The to use for discovering peers.
discoverTimeMS int The wait time, after all requests have been made, in milliseconds before all discovered peers are returned.
Результат Dictionary>>

DiscoverPeersAsync() публичный статический Метод

Discover local peers using the provided DiscoveryMethod asynchronously. Makes a single async request for peers to announce. Ensure that you append to the OnPeerDiscovered event to handle discovered peers. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.
public static DiscoverPeersAsync ( DiscoveryMethod discoveryMethod ) : void
discoveryMethod DiscoveryMethod
Результат void

EnableDiscoverable() публичный статический Метод

Make this peer discoverable using the provided DiscoveryMethod. Uses all suitable and allowed adaptors, e.g. for IP networks uses HostInfo.IP.FilteredLocalAddresses(). IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.
public static EnableDiscoverable ( DiscoveryMethod discoveryMethod ) : void
discoveryMethod DiscoveryMethod
Результат void

EnableDiscoverable() публичный статический Метод

Make this peer discoverable using the provided DiscoveryMethod. IMPORTANT NOTE: For IP networks we strongly recommend using the UDP broadcast discovery method.
public static EnableDiscoverable ( DiscoveryMethod discoveryMethod, EndPoint localDiscoveryEndPoint ) : void
discoveryMethod DiscoveryMethod The discovery method for which this peer should be discoverable
localDiscoveryEndPoint EndPoint The local endpoint with which to make this peer discoverable
Результат void

IsDiscoverable() публичный статический Метод

Returns true if local discovery endPoints exist for the provided DiscoveryMethod.
public static IsDiscoverable ( DiscoveryMethod discoveryMethod ) : bool
discoveryMethod DiscoveryMethod
Результат bool

LocalDiscoveryEndPoints() публичный статический Метод

Returns the local endpoints that are currently used to make this peer discoverable.
public static LocalDiscoveryEndPoints ( ) : List>.Dictionary
Результат List>.Dictionary

LocalDiscoveryEndPoints() публичный статический Метод

Returns the local endpoints that are currently used to make this peer discoverable using the provided DiscoveryMethod.
public static LocalDiscoveryEndPoints ( DiscoveryMethod discoveryMethod ) : List
discoveryMethod DiscoveryMethod
Результат List