Back to product page

PeerName property


Holds user defined identity ID of remote devP2P peer.

Type

String.

Syntax

  • C#
  • C++
  • VB.NET
void devP2P.SetPeerName(IntPtr Handle, string Value);
The PeerName(Handle,value) syntax has these parts:
HandleReference to the devP2P instance.
valueBuffer with new name for remote peer.

void devP2P.GetPeerName(IntPtr Handle, StringBuilder buffer);
The PeerName(Handle) syntax has these parts:
HandleReference to the devP2P instance.
Return valueCurrent name for remote peer.

char *PeerName = value;
The PeerName(value) syntax has these parts:
valuePointer to allocated memory where remote name is stored.

Sub P2P_SetPeerName(ByVal Handle As IntPtr, ByVal Value As String)
The PeerName(Handle,value) syntax has these parts:
HandleReference to the devP2P instance.
valueBuffer with new name for remote peer.

Sub P2P_GetPeerName(ByVal Handle As IntPtr, ByVal buffer As StringBuilder)
The PeerName(Handle) syntax has these parts:
HandleReference to the devP2P instance.
Return valueCurrent name for remote peer.

Remarks

PeerName property holds ID that of the peer you're connecting to. Value isn't really important for devP2P protocol, but it is used to Search remote peer on the mediator, and when connection arrives to test if it matches what is offered by remote side. However, to be 100% sure in remote peer's identity, you should use same secret password on both sides since complete traffic is encrypted with it.

Note that devP2P will remember this property through address reference, so keep your buffers static and valid as long as devP2P needs it. devP2P will not free or touch allocated memory in any way.

Platforms

Windows
Mac OSX
Linux
BSD