/// <summary> /// process EXP event (see spec. p 13) /// </summary> protected void processEXPEvent() { try { if (session.getSocket() == null) { return; } UDTSender sender = session.getSocket().getSender(); //put all the unacknowledged packets in the senders loss list sender.putUnacknowledgedPacketsIntoLossList(); if (expCount > 16 && (long)ts.TotalMilliseconds - sessionUpSince > IDLE_TIMEOUT) { if (!connectionExpiryDisabled && !stopped) { sendShutdown(); stop(); Log.Write(this.ToString(), "Session " + session + " expired."); return; } } if (!sender.haveLostPackets()) { sendKeepAlive(); } expCount++; } catch (Exception exc) { Log.Write(this.ToString(), exc); } }
/// <summary> /// * @param host /// * @param port /// * @param endpoint /// * @throws SocketException,UnknownHostException /// </summary> /// <param name="endpoint"></param> /// <param name="session"></param> public UDTSocket(UDPEndPoint endpoint, UDTSession session) { this.endpoint = endpoint; this.session = session; this.receiver = new UDTReceiver(session, endpoint); this.sender = new UDTSender(session, endpoint); }
public void setSender(UDTSender sender) { this.sender = sender; }