@Override
        public void run()
        {
            log("Start accepting socket connections.");
            while (!shouldStop) {
                try {
                    log("Waiting for new socket.");

                    server.setSoTimeout((int)SO_TIMEOUT.toMillis());
                    final Socket socket = server.accept();
                    log("Accepted new socket connection.");

                    processingService.submit(new SocketProcessor(socket));
                } catch (Throwable t) {
                    // Log exception only when not cleanly closed.
                    if (acceptThread != null && !acceptThread.isInterrupted() && !shouldStop) {
                        if (!(t instanceof SocketTimeoutException)) { // Ignore SO_TIMEOUT when not stopping.
                            t.printStackTrace();
                        }
                    } else {
                        log("Stop accepting (interrupted?).");
                        break;
                    }
                }
            }
            log("Stopped socket accepting connections.");
        }
Get the port on which this instance is accepting sockets.

@return a port number.
xmppserver/src/test/java/org/jivesoftware/openfire/session/RemoteReceivingServerDummy.java