public Queue(IOUringThread thread, IOUringAsyncContext context, bool readNotWrite)
 {
     _thread  = thread;
     _context = context;
     // This is used to distinguish on-going read from write when cancelling.
     _keyForOperation = readNotWrite ? POLLIN : POLLOUT;
 }
 public IOUringAsyncEngine(int threadCount, bool batchOnIOUringThread)
 {
     _threads = new IOUringThread[threadCount];
     for (int i = 0; i < _threads.Length; i++)
     {
         _threads[i] = new IOUringThread(batchOnIOUringThread);
     }
 }
            public IOUringAsyncContext(IOUringThread thread, SafeHandle handle)
            {
                _iouring    = thread;
                _writeQueue = new Queue(thread, this);
                _readQueue  = new Queue(thread, this);
                bool success = false;

                handle.DangerousAddRef(ref success);
                _fd     = handle.DangerousGetHandle().ToInt32();
                _handle = handle;
            }
Beispiel #4
0
            public IOUringAsyncContext(IOUringThread thread, SafeHandle handle)
            {
                _iouring    = thread;
                _writeQueue = new Queue(thread, this, readNotWrite: false);
                _readQueue  = new Queue(thread, this, readNotWrite: true);
                bool success = false;

                handle.DangerousAddRef(ref success);
                _fd     = handle.DangerousGetHandle().ToInt32();
                _handle = handle;
                SocketPal.SetNonBlocking(handle);
            }
 public Queue(IOUringThread thread, IOUringAsyncContext context)
 {
     _thread  = thread;
     _context = context;
 }