                     deviceName = name
                 }
             #endif
-            
+
             self.service = NSNetService(domain: "local.", type: "_macremote._tcp.", name: deviceName, port: Int32(self.socket.localPort))
             self.service.delegate = self
             self.service.publish()

    private override init() {
        super.init()
    }
    
    public func startBroadCasting() {
        self.socket = GCDAsyncSocket(delegate: self, delegateQueue: dispatch_get_main_queue())
        do {
            try self.socket.acceptOnPort(0)
            var deviceName: String = "Default Name"
            
            #if os(iOS)
                deviceName = UIDevice.currentDevice().name
            #elseif os(OSX)

    public weak var delegate: MRRemoteControlServerDelegate?

    // MARK: - Member Variables

    private(set) var service: NSNetService!
    private(set) var socket: GCDAsyncSocket!
    
