/// <summary> /// handshake for connect /// </summary> protected void sendHandShake() { try { ConnectionHandshake handshake = new ConnectionHandshake(); handshake.setConnectionType(ConnectionHandshake.CONNECTION_TYPE_REGULAR); handshake.setSocketType(ConnectionHandshake.SOCKET_TYPE_DGRAM); long initialSequenceNo = SequenceNumber.random(); setInitialSequenceNumber(initialSequenceNo); handshake.setInitialSeqNo(initialSequenceNo); handshake.setPacketSize(getDatagramSize()); handshake.setSocketID(mySocketID); handshake.setMaxFlowWndSize(flowWindowSize); handshake.setSession(this); Log.Write(this.ToString(), "Sending " + handshake); endPoint.doSend(handshake); } catch (Exception exc) { Log.Write(this.ToString(), exc); } }