예제 #1
0
        private void OnPeerHandshaked(object sender, EventArgs e)
        {
            string clientName;
            string clientVersion;

            if (PeerHelper.TryGetPeerClientInfo(peerID, out clientName, out clientVersion))
            {
                this.clientName    = clientName;
                this.clientVersion = clientVersion;

                Log.LogInfo("[Peer][{0}] We handshaked with client: {1} (v{2})", endPoint, clientName, clientVersion);
            }
            else
            {
                Log.LogInfo("[Peer][{0}] We handshaked with an unknown client with peer ID: {1}", endPoint, peerID.ToHexString());
            }

            Handshaked.SafeInvoke(this, e);
        }
예제 #2
0
 /// <summary>
 /// The peer connection has been successfully handshaked.
 /// </summary>
 protected virtual void OnHandshaked()
 {
     Handshaked.SafeInvoke(this, EventArgs.Empty);
 }