Git Product home page Git Product logo

ssdpclient's People

Contributors

alopix avatar cristianomatte avatar kjpolaszek avatar okankocyigit avatar oliversluke avatar paularonofskysonos avatar pierrickrouxel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssdpclient's Issues

Package could not be resolved in Xcode 12.5

The Package could not be resolved in SPM of current Xcode 12.5 (until 12.4 it works!):

"the Swift tools version specification is missing a label; consider inserting 'swift-tools-version:' between the comment marker and the version specifier"

Until my project is relying on your nice helper client, I would like to ask if you can fix this or if you can give me advice on how to fix it myself?

Thanks in advance,
Dan

Discovers only 1 device

Dear @pierrickrouxel !

Thank you for this nice piece of work.

I am currently testing your code and it looks like it only returns the first device which matches the "searchTarget". Is this how it is designed?

Any idea how I could improve it to return all devices which match the "searchTarget"?

Oliver

Error: Bad File Descriptor

When this function is called readResponses() it gives me an error

Error code: -9982(0x-26FE), Bad file descriptor

  • domain : "com.ibm.oss.Socket.ErrorDomain"

  • errorCode : -9982
    ▿ errorReason : Optional

    • some : "Bad file descriptor"
  • bufferSizeNeeded : 0

    private func readResponses() {
    do {
    var data = Data()
    let (bytesRead, address) = try self.socket!.readDatagram(into: &data)

        if bytesRead > 0 {
            let response = String(data: data, encoding: .utf8)
            let (remoteHost, _) = Socket.hostnameAndPort(from: address!)!
            Log.debug("Received: \(response!) from \(remoteHost)")
            self.delegate?.ssdpDiscovery(self, didDiscoverService: SSDPService(host: remoteHost, response: response!))
        }
    
    } catch let error {
        Log.error("Socket error: \(error)")
        self.forceStop()
        self.delegate?.ssdpDiscovery(self, didFinishWithError: error)
    }
    

    }

Not working after IOS 16.0 Update

Below are the logs

Started

[2022-09-17T15:26:27.279+05:30] [ERROR] [SSDPDiscovery.swift:132 discoverService(forDuration:searchTarget:port:)] Socket error: Error code: -9980(0x-26FC), No route to host
Error code: -9980(0x-26FC), No route to host
[2022-09-17T15:26:27.279+05:30] [ERROR] [SSDPDiscovery.swift:75 readResponses()] Socket error: Error code: -9982(0x-26FE), Bad file descriptor
Error code: -9982(0x-26FE), Bad file descriptor

Production is down due to this:

Added on Apple Thread:
https://developer.apple.com/forums/thread/715002

Can u please help:
@pierrickrouxel @kjpolaszek @cristianomatte @okankocyigit

can't init SSDPDiscovery

I am getting a "initializer is inaccessible due to internal protection level" when I try to use the same code that you have in the tests (Swift4). What am I missing?

The service should listen on ALL local interfaces instead of only on the default interface

I have my Mac configured to use two network interfaces on two subnets.

When I use discoverService(), it will only get responses on the default interface.

The solution is to listen on all local interfaces. This is accomplished by using multiple sockets for every interface, and passing each interface's local IP address via the node: parameter to the listen() function.

That much I have already verified to work. The remaining challenge is to get all interfaces. I am working on that and will then offer a merge request.

No route to host

Hi there

when using the library and running it on my macOS (m1) simulator (iOS 14.1) it runs ok and finds the services on my network.
but when running It on a real device, iPhone 8 iOS version 14.6, I always get a socket error: No route to host

any idea why and how to solve it? thanks

Getting a service's port location

Hi,
When using SSDPClient the Location I get back contains only the service's IP and not its port. Is there a way to get it?
Thanks!

SSDP Discovery Not Working after Update to IOS 16.0

This does not work anymore on iOS16 devices (but works on simulator).
Got this error : Encountered socket error:
The operation couldn’t be completed.

[2023-05-31T14:45:42.421+07:00] [ERROR] [SSDPDiscovery.swift:132 discoverService(forDuration:searchTarget:port:)] Socket error: Error code: -9980(0x-26FC), No route to host
----> Error code: -9980(0x-26FC), No route to host
[2023-05-31T14:45:42.421+07:00] [ERROR] [SSDPDiscovery.swift:75 readResponses()] Socket error: Error code: -9982(0x-26FE), Bad file descriptor
----> Error code: -9982(0x-26FE), Bad file descriptor

Any ideas

Incorrect parsing

Response:
"HTTP/1.1 200 OK\r\nCache-Control: max-age=1800\r\nDate: Thu, 06 Jun 2024 11:01:02 GMT\r\nST: upnp:rootdevice\r\nEXT: \r\nSERVER: Platform 1.0 His/1.0 UPnP/1.0 DLNADOC/1.50\r\nUSN: uuid:898e0775-23f2-11ef-8b3d-84ba39bb8fb2::upnp:rootdevice\r\nLocation: http://192.168.1.59:38400/MediaServer/rendererdevicedesc.xml\r\n\r\n"

Parsed location:
"http://192.168.1.59:38400/MediaServer/rendererdevicedes"

Correct location:
"http://192.168.1.59:38400/MediaServer/rendererdevicedesc.xml"

Could you please fix that and submit new release? You can do that by replacing "let matches = HeaderRegex.matches(in: response, range: NSRange(location: 0, length: response.count))" with "let matches = HeaderRegex.matches(in: response, range: NSRange(location: 0, length: response.utf16.count))"

Thank you a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.