private void StartServerSocket()
 {
     try
     {
         _serverSocket = _socketFactory.CreateServerSocket(_port);
         _port         = _serverSocket.GetLocalPort();
     }
     catch (IOException e)
     {
         throw new Db4oIOException(e);
     }
     _serverSocket.SetSoTimeout(_serverConfig.TimeoutServerSocket);
 }
Beispiel #2
0
        private void AssertTimeoutBehavior(Thread serverTrigger, int serverTimeout, ISocket4Factory clientSocketFactory)
        {
            ISocket4Factory sslSocketFactory = new SslSocketFactory(new StandardSocket4Factory(), ServerCertificate());
            IServerSocket4  serverSocket     = sslSocketFactory.CreateServerSocket(0);

            serverSocket.SetSoTimeout(serverTimeout);

            serverTrigger.IsBackground = true;
            serverTrigger.Start(serverSocket);

            ISocket4 clientSocket = clientSocketFactory.CreateSocket("localhost", serverSocket.GetLocalPort());

            if (!serverTrigger.Join(MinutesToMiliseconds(2)))
            {
                serverTrigger.Abort();
                Assert.Fail("Server thread should have timedout.");
            }
        }
		private void StartServerSocket()
		{
			try
			{
				_serverSocket = _socketFactory.CreateServerSocket(_port);
				_port = _serverSocket.GetLocalPort();
			}
			catch (IOException e)
			{
				throw new Db4oIOException(e);
			}
			_serverSocket.SetSoTimeout(_serverConfig.TimeoutServerSocket);
		}
Beispiel #4
0
 public virtual void SetSoTimeout(int timeout)
 {
     _serverSocket.SetSoTimeout(timeout);
 }