diff options
author | 2016-01-26 20:09:27 +0300 | |
---|---|---|
committer | 2016-01-26 20:09:27 +0300 | |
commit | 75d80dc433348435c1f8e11fafb0d1deda1ca793 (patch) | |
tree | c06a67e2bcf6e10bf12f7caabcd43280df2d91ab /src/main/java/com/juick/xmpp/s2s/ConnectionListener.java | |
parent | bace08c34252bffd3a575ca86b2b2f420165a81b (diff) |
import s2s component
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/ConnectionListener.java')
-rw-r--r-- | src/main/java/com/juick/xmpp/s2s/ConnectionListener.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionListener.java b/src/main/java/com/juick/xmpp/s2s/ConnectionListener.java new file mode 100644 index 00000000..f29b8d09 --- /dev/null +++ b/src/main/java/com/juick/xmpp/s2s/ConnectionListener.java @@ -0,0 +1,28 @@ +package com.juick.xmpp.s2s; + +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; + +/** + * + * @author ugnich + */ +public class ConnectionListener implements Runnable { + + @Override + public void run() { + try { + ServerSocket listener = new ServerSocket(5269); + while (true) { + Socket sock = listener.accept(); + ConnectionIn conn = new ConnectionIn(sock); + XMPPComponent.addConnectionIn(conn); + Thread t = new Thread(conn); + t.start(); + } + } catch (IOException e) { + System.out.println("IOException on socket listen: " + e.toString()); + } + } +} |