コード例 #1
0
ファイル: Server.cs プロジェクト: W8023Y2014/AutoCSer
 private void read(ClientBuffer buffer, ulong index, Func <AutoCSer.Net.TcpServer.ReturnValue <ClientBuffer>, bool> onRead)
 {
     if ((int)(index >> IndexShift) == this.index)
     {
         block.Read((long)(index & MaxIndex), buffer.Buffer.Start, onRead);
     }
     else
     {
         onRead(new ClientBuffer {
             State = MemberState.BlockIndexError
         });
     }
 }
コード例 #2
0
 private void read(ClientBuffer buffer, ulong index, AutoCSer.Net.TcpServer.ServerCallback <ClientBuffer> onRead)
 {
     if ((int)(index >> IndexShift) == this.index)
     {
         block.Read((long)(index & MaxIndex), buffer.Buffer.Start, onRead);
     }
     else
     {
         onRead.Callback(new ClientBuffer {
             State = MemberState.BlockIndexError
         });
     }
 }
コード例 #3
0
            AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer> readAwaiter(AutoCSer.DiskBlock.ClientBuffer buffer, ulong index)
            {
                AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer> _awaiter_ = new AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer>();
                AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
                if (_socket_ != null)
                {
                    TcpInternalServer._p5 _inputParameter_ = new TcpInternalServer._p5
                    {
                        p0 = buffer,

                        p1 = index,
                    };
                    AutoCSer.Net.TcpServer.ReturnType _returnType_;
                    AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer> _outputParameter_ = default(AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer>);
                    _returnType_ = _socket_.GetAwaiter <TcpInternalServer._p5, AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer> >(_a2, _awaiter_, ref _inputParameter_, ref _outputParameter_);
                    if (_returnType_ != AutoCSer.Net.TcpServer.ReturnType.Success)
                    {
                        _awaiter_.Call(_returnType_);
                    }
                }
                else
                {
                    _awaiter_.Call(AutoCSer.Net.TcpServer.ReturnType.ClientException);
                }
                return(_awaiter_);
            }
コード例 #4
0
            AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> read(AutoCSer.DiskBlock.ClientBuffer buffer, ulong index)
            {
                AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
                    if (_socket_ != null)
                    {
                        TcpInternalServer._p5 _inputParameter_ = new TcpInternalServer._p5
                        {
                            p0 = buffer,

                            p1 = index,
                        };
                        TcpInternalServer._p6 _outputParameter_ = new TcpInternalServer._p6
                        {
                            Ret = buffer
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpInternalServer._p5, TcpInternalServer._p6>(_c2, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> .PushNotNull(_wait_);
                    }
                }
                return(new AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> {
                    Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }