//handshake for connect protected void SendHandShake() { ConnectionHandshake handshake = new ConnectionHandshake(); handshake.ConnectionType = ConnectionHandshake.CONNECTION_TYPE_REGULAR; handshake.SocketType = ConnectionHandshake.SOCKET_TYPE_DGRAM; long initialSequenceNo = SequenceNumber.Random(); initialSequenceNumber = initialSequenceNo; handshake.InitialSeqNo = initialSequenceNo; handshake.PacketSize = datagramSize; handshake.SocketID = mySocketID; handshake.MaxFlowWndSize = flowWindowSize; //cd 2018-08-28 handshake.SetPeerIP(this.endPoint.GetLocalAddress().Address.ToString()); handshake.SetSession(this); FlashLogger.Info("Sending " + handshake); endPoint.DoSend(handshake); connectNum++; }