private static byte[] ReadFrom(ISocket4 socket, int length) { var buffer = new byte[length]; socket.Read(buffer, 0, buffer.Length); return(buffer); }
/// <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); } }
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); }
private static byte[] ReadFrom(ISocket4 socket, int length) { byte[] buffer = new byte[length]; socket.Read(buffer, 0, buffer.Length); return buffer; }
/// <exception cref="System.IO.IOException"></exception> public virtual int Read(byte[] buffer, int offset, int count) { return(_socket.Read(buffer, offset, count)); }
public override int Read(byte[] buffer, int offset, int count) { return(_socket.Read(buffer, offset, count)); }