public void Setup() { _cbs = new MockSmartCallbacks(); _bareSock = new MockSock(); _bufferPool = new ByteBufferPool(); _sock = new SmartSock(_bufferPool, _bareSock, _cbs); }
public void Setup() { _cbs = new MockSmartCallbacks(); _bareSock = new MockSock(); _bufferPool = new MockBufferPool(); _threadSmartSock = new ThreadSmartSock(_bufferPool, _bareSock, _cbs); }
public void Setup() { _cbs = new MockSmartCallbacks(); _bareSock = new MockSock(); _bufferPool = new ByteBufferPool(); _sock = new SmartSock(_bufferPool, _bareSock, _cbs); _remoteEndPoint = new IPEndPoint(IPAddress.Loopback, 23452); }
public void Setup() { _cbs = new MockSmartCallbacks(); _bareSock = new MockSock(); _bufferPool = new ByteBufferPool(); _sock = new SmartSock(_bufferPool, _bareSock, _cbs); _endPoint = new IPEndPoint(IPAddress.Loopback, 23452); Utils.SendConnectRequest(_bareSock, _endPoint, _bufferPool); }
public static void SendConnectRequest(MockSock bareSock, IPEndPoint endPoint, BufferPoolBase bufferPool) { var header = new PacketHeader(); header.SetSessionId(PacketHeader.EmptySessionId); header.SetConnect(); var buffer = bufferPool.Get(header.HeaderLength); header.Length = (ushort)header.HeaderLength; header.WriteTo(buffer, 0); bareSock.FakeReceive(buffer, 0, header.HeaderLength, endPoint); }
public static void SendDisconnectResponse(MockSock bareSock, IPEndPoint endPoint, BufferPoolBase bufferPool) { ushort sessionId = 427; var header = new PacketHeader(); header.SetSessionId(sessionId); header.SetDisconnect(); var buffer = bufferPool.Get(header.HeaderLength); header.Length = (ushort)header.HeaderLength; header.WriteTo(buffer, 0); bareSock.FakeReceive(buffer, 0, header.HeaderLength, endPoint); }
public static void SendDisconnectRequest(MockSock bareSock, IPEndPoint endPoint, BufferPoolBase bufferPool) { SendDisconnectResponse(bareSock, endPoint, bufferPool); }