blob: 314be116cda64996a5da22c0ef925065e25fb63e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package com.juick.xmpp.s2s;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
*
* @author ugnich
*/
public class ConnectionListener implements Runnable {
ExecutorService executorService = Executors.newCachedThreadPool();
@Override
public void run() {
try {
ServerSocket listener = new ServerSocket(5269);
while (true) {
Socket sock = listener.accept();
ConnectionIn conn = new ConnectionIn(sock);
XMPPComponent.addConnectionIn(conn);
executorService.submit(conn);
}
} catch (IOException e) {
System.out.println("IOException on socket listen: " + e.toString());
}
}
}
|