             server = UDPServer(addr: self.address, port:self.port)
         }
     }
-
+    public var delegate: OSCServerDelegate?
     public var running = false
     var server: UDPServer
     

        }
        return message
    }
    func postNotification(_ element: OSCElement){
        DispatchQueue.main.async {
            if let message = element as? OSCMessage {
                NotificationCenter.default.post(name: OSCServer.didReceiveMessage, object: message)
            }
            if let bundle = element as? OSCBundle {
                NotificationCenter.default.post(name: OSCServer.didReceiveBundle, object: bundle)
                for element in bundle.elements {
                    self.postNotification(element)
                }
            }
        }

        
            if "#bundle\0".toData() == data.subdata(in: Range(0...7)){//matches string #bundle
                if let bundle = decodeBundle(data){
                    self.sendToDelegate(bundle)
                } else {
                    print("invalid packet")
                }
            } else {
                if let message = decodeMessage(data){
                    self.sendToDelegate(message)
                } else {
                    print("invalid packet")
                }
