/// <exception cref="System.IO.IOException"></exception> public virtual ISocket4 Accept() { CountingSocket4 socket = new CountingSocket4(_serverSocket.Accept()); _clients.Add(socket); return(socket); }
/// <exception cref="System.IO.IOException"></exception> public virtual ISocket4 CreateSocket(string hostName, int port) { CountingSocket4 socket = new CountingSocket4(_socketFactory.CreateSocket(hostName , port)); _sockets.Add(socket); return socket; }
/// <exception cref="System.IO.IOException"></exception> public virtual ISocket4 CreateSocket(string hostName, int port) { CountingSocket4 socket = new CountingSocket4(_socketFactory.CreateSocket(hostName , port)); _sockets.Add(socket); return(socket); }
public virtual void ResetCounters() { for (IEnumerator socketIter = ConnectedClients().GetEnumerator(); socketIter.MoveNext ();) { CountingSocket4 socket = ((CountingSocket4)socketIter.Current); socket.ResetCount(); } }
private void AssertCounter(Action<ISocket4> operation, Func<CountingSocket4, double> expectedValueRetriever, Func<IObjectContainer, double> actualValueRetriever) { ObjectContainerBase container = (ObjectContainerBase) Db(); container.WithEnvironment(delegate { CountingSocket4 countingSocket = new CountingSocket4(new NullSocket()); ISocket4 socket = new MonitoredClientSocket4(countingSocket); operation(socket); Assert.AreEqual(ByteCount, expectedValueRetriever(countingSocket)); Assert.AreEqual(ByteCount, actualValueRetriever(container)); }); }
/// <exception cref="System.IO.IOException"></exception> public virtual ISocket4 Accept() { CountingSocket4 socket = new CountingSocket4(_serverSocket.Accept()); _clients.Add(socket); return socket; }
public ISocket4 Accept() { CountingSocket4 accepted = new CountingSocket4(new NullSocket()); _acceptedSockets.Add(accepted); return accepted; }