aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/XMPPComponent.java')
-rw-r--r--src/main/java/com/juick/xmpp/s2s/XMPPComponent.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java b/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
index 245038d4..db7b11ac 100644
--- a/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
+++ b/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
@@ -10,6 +10,8 @@ import org.xmlpull.v1.XmlPullParserException;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
@@ -184,8 +186,19 @@ public class XMPPComponent implements ServletContextListener {
childParsers.put(JuickMessage.XMLNS, new JuickMessage());
executorService.submit(() -> connRouter = new ConnectionRouter(this, componentName, conf.getProperty("xmpp_password")));
- executorService.submit(new ConnectionListener(this));
executorService.submit(new CleaningUp(this));
+ final ServerSocket listener = new ServerSocket(5269);
+ LOGGER.info("s2s listener ready");
+ while (true) {
+ try {
+ Socket socket = listener.accept();
+ ConnectionIn client = new ConnectionIn(this, new JuickBot(this), socket);
+ addConnectionIn(client);
+ executorService.submit(client);
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, "s2s error", e);
+ }
+ }
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "XMPPComponent error", e);
}