Package java.net

Examples of java.net.ServerSocket


      if (executor == null)
         throw new IllegalArgumentException("Required property 'executor' not specified");
     
      try
      {
         server = new ServerSocket(port, backlog, bindAddress);
         log.debug("Started server: " + server);
        
         listen();
      }
      catch(java.net.BindException be)
View Full Code Here


    */
   public void stop()
   {
      try
      {
         ServerSocket srv = server;
         server = null;
         srv.close();
      }
      catch (Exception ignore) {}
   }
View Full Code Here

   {
      // un-share instance for in-vm discovery
      NamingContext.removeHANamingServerForPartition(this.clusterPartition.getPartitionName());

      // Stop listener
      ServerSocket s = this.bootstrapSocket;
      this.bootstrapSocket = null;
      if (s != null)
      {
         this.log.debug("Closing the HAJNDI bootstrap listener");
         s.close();
      }

      // Stop HAJNDI service
      this.log.debug("Stopping the HAJNDI service");
      this.theServer.shutdown();
View Full Code Here

         log.error("Failed to init SSLContext", e);
         throw new IOException("Failed to get SSLContext for TLS algorithm");
      }

      ServerSocketFactory factory = sslCtx.getServerSocketFactory();
      ServerSocket serverSocket = factory.createServerSocket(0);
      getLog().debug("Created serverSocket: "+serverSocket);
      int port = serverSocket.getLocalPort();
      InetAddress addr = serverSocket.getInetAddress();
      httpsURL = "https://localhost:" + port + '/';
      AcceptThread thread = new AcceptThread(serverSocket, getLog(), httpsURL);
      synchronized( httpsURL )
      {
         log.debug("Starting server socket thread");
View Full Code Here

      activeInstanceRef = UnicastRemoteObject.exportObject(activeInstance);

      testInstance = new RemoteAspectManagerImpl(false);
      testInstanceRef = UnicastRemoteObject.exportObject(testInstance);

      listener = new ServerSocket(portNumber);

      Thread worker = new Thread() {
        public void run() {
          while (systemUp) {
            try {
View Full Code Here

      return this.server.getLocalPort();
   }
  
   public void start() throws Exception
   {
      this.server = new ServerSocket(0, 200, null);
      this.server.setSoTimeout(15000);
     
      for (int i = 0; i < this.threads; ++i)
      {
         Thread thread = new Thread(this);
View Full Code Here

      throws Exception
   {
      try
      {
         new ConnectionAcceptor( new AcceptorConfig( "name",
                                                     new ServerSocket(),
                                                     new MockSocketConnectionHandler() ),
                                 null );
      }
      catch ( NullPointerException npe )
      {
View Full Code Here

      throws Exception
   {
      final RecordingAcceptorMonitor monitor = new RecordingAcceptorMonitor();
      final ConnectionAcceptor acceptor =
         new ConnectionAcceptor( new AcceptorConfig( "name",
                                                     new ServerSocket(),
                                                     new MockSocketConnectionHandler() ),
                                 monitor );
      assertEquals( "errorClosingServerSocket pre-shutdownServerSocket()",
                    null,
                    monitor.getErrorClosingServerSocket() );
View Full Code Here

      throws Exception
   {
      final Mock mockLogger = new Mock( Logger.class );

      final String name = "MyName";
      final ServerSocket serverSocket = new ServerSocket( 2023 );
      final IOException ioe = new IOException();

      final String acceptorCreatedMessage =
         "Creating Acceptor " + name + " on " +
         serverSocket.getInetAddress().getHostAddress() + ":" +
         serverSocket.getLocalPort() + ".";

      final String acceptorClosingMessage =
         "Closing Acceptor " + name + ".";

      final String serverSocketListening =
View Full Code Here

      throws Exception
   {
      final Mock mockLogger = new Mock( Logger.class );

      final String name = "MyName";
      final ServerSocket serverSocket = new ServerSocket( 2023 );
      final IOException ioe = new IOException();

      final String acceptorCreatedMessage =
         "Creating Acceptor " + name + " on " +
         serverSocket.getInetAddress().getHostAddress() + ":" +
         serverSocket.getLocalPort() + ".";

      final String acceptorClosingMessage =
         "Closing Acceptor " + name + ".";

      final String serverSocketListening =
View Full Code Here

TOP

Related Classes of java.net.ServerSocket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.