Show / Hide Table of Contents

Class Peer

A representation of peer node.

Inheritance
Object
Peer
BoundPeer
Namespace: Libplanet.Net
Assembly: Libplanet.dll
Syntax
public class Peer : ISerializable

Constructors

| Improve this Doc View Source

Peer(PublicKey, AppProtocolVersion)

Declaration
public Peer(PublicKey publicKey, AppProtocolVersion appProtocolVersion)
Parameters
Type Name Description
PublicKey publicKey
AppProtocolVersion appProtocolVersion
| Improve this Doc View Source

Peer(SerializationInfo, StreamingContext)

Declaration
protected Peer(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info
StreamingContext context

Properties

| Improve this Doc View Source

Address

The peer's address which is derived from its PublicKey.

Declaration
public Address Address { get; }
Property Value
Type Description
Address
See Also
PublicKey
| Improve this Doc View Source

AppProtocolVersion

The corresponding application protocol version of this peer.

Declaration
public AppProtocolVersion AppProtocolVersion { get; }
Property Value
Type Description
AppProtocolVersion
| Improve this Doc View Source

PublicIPAddress

Declaration
public IPAddress PublicIPAddress { get; }
Property Value
Type Description
IPAddress
| Improve this Doc View Source

PublicKey

The corresponding PublicKey of this peer.

Declaration
public PublicKey PublicKey { get; }
Property Value
Type Description
PublicKey

Methods

| Improve this Doc View Source

GetObjectData(SerializationInfo, StreamingContext)

Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info
StreamingContext context
| Improve this Doc View Source

IsCompatibleWith(AppProtocolVersion, IEnumerable<PublicKey>, DifferentAppProtocolVersionEncountered)

Determines if the peer is compatible with the given criteria.

Declaration
public bool IsCompatibleWith(AppProtocolVersion localVersion, IEnumerable<PublicKey> trustedSigners = null, DifferentAppProtocolVersionEncountered recognizer = null)
Parameters
Type Name Description
AppProtocolVersion localVersion

The version of the currently running application.

IEnumerable<PublicKey> trustedSigners

A list of signers to trust. An empty list means to trust no one, so that this method always returns false. Conversely, null means to trust anyone. Be aware of the difference of those two.

DifferentAppProtocolVersionEncountered recognizer

A callback to determine an encountered peer's AppProtocolVersion is compatible with the currently running application, in the case of the peer's version signature is trustworthy but its version number is not the same.

Returns
Type Description
Boolean

true if the peer is compatible with the given criteria. Otherwise false.

| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String

Operators

| Improve this Doc View Source

Equality(Peer, Peer)

Declaration
public static bool operator ==(Peer left, Peer right)
Parameters
Type Name Description
Peer left
Peer right
Returns
Type Description
Boolean
| Improve this Doc View Source

Inequality(Peer, Peer)

Declaration
public static bool operator !=(Peer left, Peer right)
Parameters
Type Name Description
Peer left
Peer right
Returns
Type Description
Boolean

See Also

Swarm<T>
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium