Discover all the services on the network using NSH

I am trying to find all services on the network using:

mNsdManager.discoverServices( SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener); 

but you must define SERVICE_TYPE, for example:

 public static final String SERVICE_TYPE = "_http._tcp."; 

so it will detect all http services using tcp, but will not find https services at the same time or any other services

How can I install all this to find any service using tcp?

Thanks in advance.

+5
source share
1 answer

I use

 private static final String SERVICE_TYPE = "_services._dns-sd._udp"; 

which gives me a list of all available services on the local network:

 D/MHC-NSD: Service discovery found: name: _workstation, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _UnoWiFi, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _udisks-ssh, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _airplay, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _raop, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _xbmc-events, type: _udp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _xbmc-jsonrpc, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _xbmc-jsonrpc-h, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _http, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _sftp-ssh, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _ssh, type: _tcp.local., host: null, port: 0 D/MHC-NSD: Service discovery found: name: _arduino, type: _tcp.local., host: null, port: 0 
+1
source

All Articles