Peer MemberssP2P NAT Traversal and peer-to-peer networking API
sP2P NAT Traversal and peer-to-peer networking API

The Peer type exposes the following members.
Constructors

  NameDescription
Public methodPeer
Initialises new instance of Peer class
Back to Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetBytes
Serialises object as byte array
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetSerializationLength
Calculates number of bytes needed in array to store serialisation of peer object
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodParse
Initialises object values form byte array
Public methodStatic memberParsePeer( Byte , Int32)
Creates Peer object from byte array
Public methodStatic memberParsePeer( Byte , Int32 , Int32)
Creates Peer object from byte array
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodWriteBytes
Write peer object serialisation to byte array buffer
Back to Top
Extension Methods

  NameDescription
Public Extension MethodWriteLogEntry
Writes new log entry
(Defined by Logger.)
Back to Top
Fields

  NameDescription
Public fieldStatic memberAuthentificatedState
Constant equal to Peer connected state, immediately after successfully session opening
Public fieldStatic memberDisconnectedState
Constant equal to Peer disconnected state
Back to Top
Properties

  NameDescription
Public propertyAllProperties
Public propertyAPIVersion
Gets or sets the API version. Do not set it yourself!
Public propertyApplicationUID
Used to store UID application peer is using
Public propertyCanTCPAccept
Get or sets value indicating peer can perform socket::accept
Public propertyCheckPointEP
IP end point of peer's checkpoint server
Public propertyCheckPointUID
Unique identifier of peer's CheckPoint server
Public propertyHasNUPnP
Get or sets value indicating NAT PNP or UPnP presence in NAT device
Public propertyHostName
Used to store UTF8 host name of peers machine. Max length is 255
Public propertyItem
Custom properties associated with Peer object. Note this: When serialised Object.ToString() is used, if you store complex object .ToString() usually returns type name. XML serialisation can be useful for transferring complex objects.
Remarks

Maximal length of serialised byte sequence of all custom properties is limited to 7000 bytes - this also includes length of property names! DO NOT USE THIS PROPERTIES TO TRANSFER LARGE DATA LIKE base64 image string or so!!!
Examples

Peer Peer1 = new Peer();
Peer1["Email"] = "someone@whatever.com";
...
Public propertyLastActivityTime
Reserved for managing object to keep track of last activity time of peer
Public propertyLocalEP
Peer local end point
Public propertyNATTravMethodsUsed
After NAT Traversal operation this property will be set as ordered list of tunnel methdos applyed during process. Last one will indicate final successful method. This property is valid only in Peer argument in successfull connect tunnel handler function
Public propertyNatType
Gets or sets NAT behaviour type of peer
Public propertyOS
Used to store UTF8 operating system name of peers machine. Max length is 255
Public propertyPublicEP
Peer's public end point
Public propertySocket
Each managing class can use this property to assign, socket value for it's need. This property can not be serialised
Public propertyState
Gets or sets integer (UInt32) value representing status of peer, 0 (Peer.DisconnectedState) is reserved for disconnection, 1 (Peer.AuthentificatedState) is state immediately after CP authentication other values can be used freely in applications
Public propertyTag
Auxiliary property that may be used for various purposes
Public propertyTunnelSecretData
Set only when peer object is argument of tunnel open complete handler. It contains secret 32 byte array known only to peers on two tunnel sides. Array is generated by using data exchanged by Diffie–Hellman key exchange algoritham. Use of data is not strict. It can be used at will to generate further keys for encryption.
Public propertyUID
Unique identifier of peer
Back to Top
See Also