예제 #1
0
        private static byte[] ReadFrom(ISocket4 socket, int length)
        {
            var buffer = new byte[length];

            socket.Read(buffer, 0, buffer.Length);
            return(buffer);
        }
예제 #2
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public virtual int Read(byte[] buffer, int bufferOffset, int byteCount)
 {
     try
     {
         return(_delegate.Read(buffer, bufferOffset, byteCount));
     }
     catch (IOException e)
     {
         throw new Db4oIOException(e);
     }
 }
예제 #3
0
        public void TestServerReadSocketTimeout()
        {
            Thread server = new Thread(delegate(object serverSocket)
            {
                ISocket4 client = AsServerSocket(serverSocket).Accept();
                client.SetSoTimeout(1000);
                Assert.Expect(typeof(Exception), delegate
                {
                    client.Read(new byte[1], 0, 1);
                });
            });

            int             serverTimeout       = MinutesToMiliseconds(5);
            ISocket4Factory clientSocketFactory = new SslSocketFactory(new StandardSocket4Factory(), delegate { return(true); });

            AssertTimeoutBehavior(server, serverTimeout, clientSocketFactory);
        }
예제 #4
0
		private static byte[] ReadFrom(ISocket4 socket, int length)
		{
			byte[] buffer = new byte[length];
			socket.Read(buffer, 0, buffer.Length);
			return buffer;
		}
예제 #5
0
 /// <exception cref="System.IO.IOException"></exception>
 public virtual int Read(byte[] buffer, int offset, int count)
 {
     return(_socket.Read(buffer, offset, count));
 }
예제 #6
0
 public override int Read(byte[] buffer, int offset, int count)
 {
     return(_socket.Read(buffer, offset, count));
 }