public void AddSocket(AsyncSocket socket, IProcatorEvents procatorEvents) { var item = new Item(procatorEvents); m_sockets.Add(socket, item); m_completionPort.AssociateSocket(socket, item); AdjustLoad(1); }
public void Unplug() { Debug.Assert(m_ioThread != null); // Forget about old poller in preparation to be migrated // to a different I/O thread. m_ioThread = null; m_handler = null; }
// Add a timeout to expire in timeout_ milliseconds. After the // expiration timer_event on sink_ object will be called with // argument set to id_. public void AddTimer(long timeout, IProcatorEvents sink, int id) { long expiration = Clock.NowMs() + timeout; TimerInfo info = new TimerInfo(sink, id); if (!m_timers.ContainsKey(expiration)) { m_timers.Add(expiration, new List <TimerInfo>()); } m_timers[expiration].Add(info); }
public Item(IProcatorEvents procatorEvents) { ProcatorEvents = procatorEvents; Cancelled = false; }
public void SetHandler(IProcatorEvents handler) { this.m_handler = handler; }