public PseudoTcpSocket.WriteResult WritePacket( PseudoTcp.PseudoTcpSocket sock, byte[] buffer, uint len, object user_data) { try { this.udpc.Send(buffer, (int)len); PLog.DEBUG("Sent {0} bytes to UDPClient at {1}:{2}", len, remoteAddr, remotePort); return(PseudoTcpSocket.WriteResult.WR_SUCCESS); } catch (Exception e) { Console.WriteLine(e.ToString()); return(PseudoTcpSocket.WriteResult.WR_FAIL); } }
public static void AdjustClock(PseudoTcp.PseudoTcpSocket sock, Queue notifyClockQueue) { ulong timeout = 0; if (SyncPseudoTcpSocket.GetNextClock(sock, ref timeout)) { PLog.DEBUG("AdjustClock: GetNextClock={0}", timeout); uint now = PseudoTcpSocket.GetMonotonicTime(); if (now < timeout) { timeout -= now; } else { timeout = now - timeout; } //Console.WriteLine ("...original timeout={0}", timeout); //if (timeout > 900) // timeout = 100; /// Console.WriteLine ("Socket {0}: Adjusting clock to {1} ms", sock, timeout); notifyClockQueue.Enqueue(Environment.TickCount + (int)timeout); } else { PLog.DEBUG("AdjustClock: didnt get timeout"); /*left_closed = true; * * if (left_closed && right_closed) * g_main_loop_quit (mainloop);*/ } }
public void Writable(PseudoTcp.PseudoTcpSocket sock, object data) { PLog.DEBUG("UdpCallbacks.Writeable"); }
public void Opened(PseudoTcp.PseudoTcpSocket sock, object data) { PLog.DEBUG("UdpCallbacks.Opened"); }