       incomingMessagesSink.put(Event.Next(Box(message)))
     }
   }
+
+  func applicationWillResign() {
+    NSLog("[OSCService] Application will resign, stopping OSC server")
+    localServer.stop()
+  }
+
+  func applicationDidBecomeActive() {
+    NSLog("[OSCService] Application became active")
+  }
   
   // TODO rewrite
   func handleDisconnect(error: NSError!) {

        },
        error: { error in () }
      )
  }
  
  func sendMessage(message: OSCMessage) {

    incomingMessagesSink = sink

    super.init()
    localServer.delegate = self

    startLocalServer()

    Settings.serverAddress.producer
      // TODO ignoreNil would be nice
      |> filter { $0 != nil }
