diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-29 14:22:18 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-29 14:22:18 +1300 |
commit | f5233acc2078564aceadc9fe72e5a0998b2e04a3 (patch) | |
tree | 41d91aded6ec9ac9c26d866fcebe87c49cdf4d28 /src/org/traccar/TrackerServer.java | |
parent | 1fe18b404796c47e0eec31b4a40c9e4087e997b9 (diff) | |
download | trackermap-server-f5233acc2078564aceadc9fe72e5a0998b2e04a3.tar.gz trackermap-server-f5233acc2078564aceadc9fe72e5a0998b2e04a3.tar.bz2 trackermap-server-f5233acc2078564aceadc9fe72e5a0998b2e04a3.zip |
Fix UDP servers
Diffstat (limited to 'src/org/traccar/TrackerServer.java')
-rw-r--r-- | src/org/traccar/TrackerServer.java | 7 |
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"); |