Questions tagged [nsnetservice]

The NSNetService class represents a network service, either one your application publishes or is a client of. Available in OS X v10.2 and later with Apple's Foundation framework.

The methods of NSNetService operate asynchronously so your application is not impacted by the speed of the network. All information about a service is returned to your application through the NSNetService object’s delegate. You must provide a delegate object to respond to messages and to handle errors appropriately.

NSNetService class and the NSNetServiceBrowser class use multicast DNS to convey information about network services to and from your application. The API of NSNetService provides a convenient way to publish the services offered by your application and to resolve the socket address for a service.

The types of services you access using NSNetService are the same types that you access directly using BSD sockets. HTTP and FTP are two services commonly provided by systems. (For a list of common services and the ports used by those services, see the file /etc/services.) Applications can also define their own custom services to provide specific data to clients.

Source: NSNetService class reference

Related tags:

112 questions
0
votes
1 answer

GCDAsyncSocket client/server not working over iOS access point

I have a very simple TCP client/server implementation using GCDAsyncSocket (7.5.0) and I'm using NSNetService for service discovery. It's used only on a local wifi network and it works for 2 years with no problem (just to say : I have a proper use…
Pierre Mardon
  • 727
  • 8
  • 25
0
votes
1 answer

Bonjour/NSNetService Data written to NSOutputStream never makes it to the other side (includesPeerToPeer = true)

I have an iOS app that establish a peer-to-peer connection through Bonjour/NSNetService. (based on the WiTap sample code) In some cases, both devices won’t receive data anymore after a few seconds while they are still able to write data out (i.e.…
0
votes
1 answer

Scan local network to detect windows/mac/linux computers with iPhone

I'm trying to figure how to perform some networking tasks using Objective C on the iPhone. I'd like to enumerate all network devices on my local, home network. Also, I'd like to be able to ping individual devices. Does anyone know how and what…
Justin Kredible
  • 8,354
  • 15
  • 65
  • 91
0
votes
1 answer

Bonjour IM Client

I want to make an iPhone app which communicates with iChat on Mac OS X via Bonjour. I have already known how to create a service using NSNetService, but how can I communicate with iChat? What service type do I need? Any help would be appreciated.…
nonamelive
  • 6,510
  • 8
  • 40
  • 47
0
votes
1 answer

iPad netservice with more devices

Heey I want to make a netservice where more ipads can connect to at the same time. I made a one 1 iPad open a NSNetservice and open the in- and outputstream. I started a netservice on iPad A, When connecting with iPad B to iPad A this just works…
Mats Stijlaart
  • 5,058
  • 7
  • 42
  • 58
0
votes
1 answer

Uniquely identify client connecting to an NSNetService/NSStream

I'm opening two NSStreams pairs (input/output) between a client app and a server app, and need to associate those two streams on the same server-side object. The two stream approach means that didAcceptConnectionWithInputStream will be called twice,…
Rob Reuss
  • 1,400
  • 10
  • 20
0
votes
0 answers

Bonjour: Publish a NSNetService in iOS/Objective-C with Service name and type

I have seen that a NSNetService can publish a Bonjour service setting up the service name and the service type. I do: /** Publish this Socket Server on local domain @param serviceName String The service name to publish @param serviceType String…
loretoparisi
  • 15,724
  • 11
  • 102
  • 146
0
votes
1 answer

NSNetService: Handle name conflicts when publish service

According to the Apple documentation : If that service name conflicts with an existing service on the network, Bonjour chooses a new name. ... your service is automatically renamed if it conflicts with the name of an existing service on the…
Sebastian
  • 3,379
  • 2
  • 23
  • 39
0
votes
1 answer

iOS, getting a 'snapshot' of available Bonjour services

For my iOS app I want to check when starting if there is a specific service advertised using Bonjour and if so connect to that host (instead of a specified URL). I have implemented in my code: if (self.services) { [self.services…
Kostas
  • 367
  • 1
  • 3
  • 17
0
votes
0 answers

Multiple NSStreams inside a NSStream, NSNetService with multiple streams

Basically i use NSNetService, which provides you with one i/o stream pair - (void)netService:(NSNetService *)sender didAcceptConnectionWithInputStream:(NSInputStream *)inputStream outputStream:(NSOutputStream *)outputStream I need to use however…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
0
votes
1 answer

Connect to BLE device and send/read data via NSNetService on iOS 7

I have an iPhone app which communicates with external device via NSNetService. Now I want to add support for bluetooth. So I would like to discover and connect to device via bluetooth (BLE) and when connected I would like to send/receive data via…
0
votes
1 answer

Peer-peer connection having different IP Adress

I want to connect devices having different IP Address. For Example: Device A is using Mobile networking and Device B is also using a mobile network .then Is it possible to connect them ?If Yes How ,If no why ?
Jayaprada
  • 944
  • 8
  • 11
0
votes
1 answer

NSNetService publishes, but didAcceptConnectionWithInputStream... is never called

I've been trying to make a simple app on iOS that will receive a message, and then perform an action based on that message (at the moment I just want to show it via NSLog). I can connect to the service, but the service never seems to receive…
Joseph Duffy
  • 4,566
  • 9
  • 38
  • 68
0
votes
2 answers

I have a service that is published in Android. How to browser it in iOS?

We are creating a multi-platform apps for both Android and iOS. Currently, we have a services that is published in Android with these information Type:_http._tcp or _http._udp Name: abcController port Now, I want to browse "abcController" services…
0
votes
1 answer

Why does MCNearbyServiceAdvertiser use a dispatch queue internally?

While I was browsing through the iOS 7 runtime headers, something caught my eye. In the MCNearbyServiceAdvertiser class, part of the Multipeer Connectivity framework, a property called syncQueue is and multiple methods prefixed with sync are…
datwelk
  • 1,017
  • 1
  • 9
  • 18