use of com.neuronrobotics.sdk.network.BowlerUDPServer in project java-bowler by NeuronRobotics.
the class BowlerAbstractServer method startNetworkServer.
public void startNetworkServer(final int port) throws IOException {
udpServer = new BowlerUDPServer(port);
serverSocket = new ServerSocket(port + 1);
new Thread() {
public void run() {
setName("Bowler Platform Network Server");
addServer(udpServer);
while (true) {
Socket s;
try {
// ex.printStackTrace();
Log.warning("\n\nWaiting for UDP connection on port " + (port) + "...");
Log.warning("\n\nWaiting for TCP connection on port " + (port + 1) + "...");
s = serverSocket.accept();
addServer(new BowlerTCPServer(s));
Log.warning("Got a connection!");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}.start();
}
Aggregations