Example #1
0
        protected virtual void CloseSAEA(SocketAsyncEventArgs saea, SAEAPool pool = null)
        {
            if (null != pool)
            {
                pool.Recycle(saea);
            }

            RawMessage message = new RawMessage();

            message.data = remote;
            onClosedCallback.SafeInvoke(message);
        }
Example #2
0
        protected void Initialize(int ioNum, int bufferSize = NetDefine.DEFAUT_BUFFER_SIZE)
        {
            sendSAEAPool = new SAEAPool(ioNum,
                                        new EventHandler <SocketAsyncEventArgs>(OnSAEACompleted),
                                        bufferSize);

            receiveSAEAPool = new SAEAPool(ioNum,
                                           new EventHandler <SocketAsyncEventArgs>(OnSAEACompleted),
                                           bufferSize);

            receiveBuffer = new DynamicBuffer(ioNum * bufferSize);
        }