@Override
        public void run()
        {
            log("Start accepting socket connections (as Server Dialback Authoritative Server).");
            while (!shouldStop) {
                try {
                    dialbackAuthoritativeServer.setSoTimeout((int)SO_TIMEOUT.toMillis());
                    final Socket socket = dialbackAuthoritativeServer.accept();
                    final InputStream is = socket.getInputStream();
                    final OutputStream os = socket.getOutputStream();
                    log("DIALBACK AUTH SERVER: Accepted new socket connection.");

                    final byte[] buffer = new byte[1024 * 16];
                    int count;
                    while ((count = is.read(buffer)) > 0) {
                        String read = new String(buffer, 0, count);
                        log("# DIALBACK AUTH SERVER recv");
                        log(read);
                        log("");

                        final Document outbound = DocumentHelper.createDocument();
                        final Namespace namespace = new Namespace("stream", "http://etherx.jabber.org/streams");
                        final Namespace dialbackNamespace = new Namespace("db", "jabber:server:dialback");
                        final Element stream = outbound.addElement(QName.get("stream", namespace));
                        stream.add(Namespace.get("jabber:server"));
                        stream.add(dialbackNamespace);
                        stream.addAttribute("from", XMPP_DOMAIN);
                        stream.addAttribute("to", connectTo);
                        stream.addAttribute("version", "1.0");

                        String response = null;
                        read = read.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "").trim();
                        if (read.startsWith("<stream:stream ")) {
                            stream.addElement(QName.get("features", namespace));
                            response = stream.asXML().substring(0, stream.asXML().indexOf("</stream:stream>"));
                        } else if (read.startsWith("<db:")) {
                            final int idStart = read.indexOf("id=\"") + 4;
                            final int idEnd = read.indexOf('"', idStart);
                            final String id = read.substring(idStart, idEnd);

                            // Blindly verify anything.
                            final Element verify = stream.addElement(QName.get("verify", dialbackNamespace));
                            verify.addAttribute("from", XMPP_DOMAIN);
                            verify.addAttribute("to", connectTo);
                            verify.addAttribute("id", id);
                            verify.addAttribute("type", "valid");
                            response = verify.asXML();
                        } else if (read.equals("</stream:stream>")) {
                            response = "</stream:stream>";
                        } else {
                            log("I don't know how to process this data.");
                        }

                        if (response != null) {
                            log("# DIALBACK AUTH SERVER send to Openfire");
                            log(response);
                            log("");
                            os.write(response.getBytes());
                            os.flush();

                            if (response.equals("</stream:stream>")) {
                                socket.close();
                                break;
                            }
                        }
                    }
                } catch (Throwable t) {
                    // Log exception only when not cleanly closed.
                    if (dialbackAcceptThread != null && !dialbackAcceptThread.isInterrupted() && !shouldStop) {
                        if (!(t instanceof SocketTimeoutException)) { // Ignore SO_TIMEOUT when not stopping.
                            t.printStackTrace();
                        }
                    } else {
                        log("Stop accepting (as Server Dialback Authoritative Server) (interrupted/closed).");
                        break;
                    }
                }
            }
            log("Stopped accepting socket connections (as Server Dialback Authoritative Server).");
        }
Returns all stream 'to' attribute values (potential duplicates, but no null values) that were received from the
peer during the setup.

@return all stream 'to' attribute values received from the peer.
xmppserver/src/test/java/org/jivesoftware/openfire/session/RemoteInitiatingServerDummy.java