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

How can a server know which client is connecting it while the client is using getInputStream:outputStream:?

I am using hotspot to communicate with iPhone, I publish netservice and connect each other. While every client can find many devices, when one of them connect my device by using getInputStream:outputStream:, how can I know which one is connecting…
0
votes
1 answer

How can I limit the amount of clients in NSNetService?

I've successfully created a server/client TCP connection, and now I want to stop the service advertising but DO NOT want the server to stop!, basically want to accept only 1 client. EDIT: want to be able to add maxClients variable, so I can modify…
user1411443
0
votes
1 answer

Updating TXTRecordDictionary doesn't always notify monitoring services

I'm using bonjour to find other devices. Each device uses TXTRecordData to share its name: NSDictionary* dictionary = @{ @"name": @"Goose" }; [service setTXTRecordData:[NSNetService dataFromTXTRecordDictionary:dictionary]]; Each device listens for…
bendytree
  • 13,095
  • 11
  • 75
  • 91
0
votes
1 answer

Nested NSDictionary in TXTRecordData Returns NULL

I'm using NSNetService and want to store some data in TXTRecordData. If I just store an NSString, it works OK - but if I store a nested dictionary then dataFromTXTRecord... returns nil. For example: NSData* d = [NSNetService…
bendytree
  • 13,095
  • 11
  • 75
  • 91
0
votes
0 answers

NSNetService (bonjour) cannot find devices

I tried to make an app to communicate between iOS devices and I found "Chatty", which is based on NSNetService (Bonjour) and it works on my devices. (iPad 3Gen, iPhone 4S and iPhone 5) However, there's a problem, some devices cannot find each other…
Hiraku
  • 361
  • 3
  • 13
-1
votes
1 answer

How to communicate from multiple device to single device without internet

I want to send data from multiple apple watches to a single iPhone without internet connection. Bluetooth is not a good option because of limited number of devices that can join at time and low range. what can be the next option for this?
Anju
  • 563
  • 2
  • 6
  • 13
-1
votes
1 answer

In swift NSNetService class how to send data using getInoutStream

Currently I am working on a program in which i am connecting two IOS devices using NSNetService class. I am able to connect both the devices but i don't know how to send data using getInoutStream function. Can any buddy help me.
Avim
  • 101
  • 1
  • 10
1 2 3 4 5 6 7
8