aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/TrackerServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/TrackerServer.java')
-rw-r--r--src/org/traccar/TrackerServer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/TrackerServer.java b/src/org/traccar/TrackerServer.java
index 1d7185fe6..1b3677836 100644
--- a/src/org/traccar/TrackerServer.java
+++ b/src/org/traccar/TrackerServer.java
@@ -46,7 +46,12 @@ public abstract class TrackerServer {
this.bootstrap = bootstrap;
this.protocol = protocol;
- bootstrap.setFactory(GlobalChannelFactory.getFactory());
+ // Set appropriate channel factory
+ if (bootstrap instanceof ServerBootstrap) {
+ bootstrap.setFactory(GlobalChannelFactory.getFactory());
+ } else if (bootstrap instanceof ConnectionlessBootstrap) {
+ bootstrap.setFactory(GlobalChannelFactory.getDatagramFactory());
+ }
address = serverManager.getProperties().getProperty(protocol + ".address");
String portProperty = serverManager.getProperties().getProperty(protocol + ".port");