Esempio n. 1
0
        public static IOArgs Alloc(IOHandler handler, int size = -1)
        {
            IOArgs args = Alloc(size);

            args.Handler = handler;

            return(args);
        }
Esempio n. 2
0
        internal static void Return(IOArgs args)
        {
            if (_argsPool.Count > MaxArgsCount)
            {
                args.BaseDispose();
            }

            _argsPool.Enqueue(args);
        }
Esempio n. 3
0
        private static void OnIO(object sender, SocketAsyncEventArgs sArgs)
        {
            IOArgs args = (IOArgs)sArgs;

            if (args.Handler == null)
            {
                args.Dispose();
            }
            else
            {
                args.Handler.SubmitIO(args);
            }
        }
Esempio n. 4
0
 public void Submit(IOArgs args)
 {
     _pendingArgs.Add(args);
 }
Esempio n. 5
0
 public abstract void OnIOException(IOArgs args, Exception ex);
Esempio n. 6
0
 public abstract void OnIO(IOArgs args);
Esempio n. 7
0
 public void SubmitIO(IOArgs args)
 {
     Queue.Submit(args);
 }