From fe19c8b73039d27676a7f8f80ed3bb0dfa9e2278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Fri, 27 Jan 2012 15:00:01 +0100 Subject: Clean up SameService. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit – Only send broadcasts. – Don't start Same components without SameController. --- .../src/main/java/com/orbekk/discovery/SameService.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'same-android/src') diff --git a/same-android/src/main/java/com/orbekk/discovery/SameService.java b/same-android/src/main/java/com/orbekk/discovery/SameService.java index 68a6c0b..19df9e3 100644 --- a/same-android/src/main/java/com/orbekk/discovery/SameService.java +++ b/same-android/src/main/java/com/orbekk/discovery/SameService.java @@ -60,21 +60,17 @@ public class SameService extends Service { discoveryThread.start(); } } - new Thread() { - @Override public void run() { - new MasterApp().run(PORT+1); - } - }.start(); } private void sendBroadcastDiscovery() { - byte[] data = "Discover".getBytes(); + String message = "Discover " + (PORT + 2); + byte[] data = message.getBytes(); new Broadcaster(this).sendBroadcast(data, PORT); } private void joinNetwork() { sendBroadcastDiscovery(); - new ClientApp().run(PORT+2, "ClientNetwork", null); + // new ClientApp().run(PORT+2, "ClientNetwork", null); } @Override -- cgit v1.2.3