示例#1
0
        /// <exception cref="System.IO.IOException"></exception>
        public virtual ISocket4 Accept()
        {
            CountingSocket4 socket = new CountingSocket4(_serverSocket.Accept());

            _clients.Add(socket);
            return(socket);
        }
示例#2
0
		/// <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;
		}
示例#3
0
        /// <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);
        }
示例#4
0
 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));
			});
		}
示例#6
0
		/// <exception cref="System.IO.IOException"></exception>
		public virtual ISocket4 Accept()
		{
			CountingSocket4 socket = new CountingSocket4(_serverSocket.Accept());
			_clients.Add(socket);
			return socket;
		}
示例#7
0
		public ISocket4 Accept()
		{
			CountingSocket4 accepted = new CountingSocket4(new NullSocket());
			_acceptedSockets.Add(accepted);
			return accepted;
		}