예제 #1
0
        public void Unbid(Ring ring)
        {
            IsUnbinding = true;
            int socket = Socket;

            bool prepared;

            if (ring.Supports(RingOperation.Cancel))
            {
                prepared = ring.TryPrepareCancel(AsyncOperation.AcceptFrom(socket).AsUlong(), AsyncOperation.CancelAccept(socket).AsUlong());
            }
            else
            {
                // pre v5.5
                prepared = ring.TryPrepareNop(AsyncOperation.CancelAccept(socket).AsUlong());
            }

            if (!prepared)
            {
                _scheduler.ScheduleCancel(AsyncOperation.CancelAccept(socket));
            }
        }