Questions tagged [nsconnection]

Questions regarding Apple's NSConnection class

Apple's NSConnection Class

An object that manages the communication between objects in different threads or between a thread and a process running on a local or remote system.

Docs: https://developer.apple.com/documentation/foundation/nsconnection

Famous Question: Best way to do interprocess communication on Mac OS X

38 questions
32
votes
3 answers

Best way to do interprocess communication on Mac OS X

I'm looking at building a Cocoa application on the Mac with a back-end daemon process (really just a mostly-headless Cocoa app, probably), along with 0 or more "client" applications running locally (although if possible I'd like to support remote…
jbrennan
  • 11,943
  • 14
  • 73
  • 115
5
votes
1 answer

NSConnection between an OSX app and a command line tool

I am trying to create a connection between an OSX app and a command line tool to work with distributed objects. The connection is registered in the command line tool like this [NSConnection serviceConnectionWithName:@"server"…
rogermushroom
  • 5,486
  • 4
  • 42
  • 68
5
votes
1 answer

Blutooth Peer To Peer Connection on iOS 7 using NSNetService

I'm trying to get the Objective C++ distributed object model working between iOS and OSX devices. Using WiFi, almost everything is fine; however, with iOS 7 Apple introduced the "includesPeerToPeer" property which should publish an NSNetService over…
Tommy356
  • 252
  • 2
  • 7
5
votes
0 answers

NSConnection died after some time on 10.8

I'm using DO with for IPC. I used following code. Its working fine in 10.6 and 10.7 but on 10.8 die even both application were ideal. // HELPER NSConnection *connection =[NSConnection new]; [[NSNotificationCenter defaultCenter] addObserver:self …
mandeep-dhiman
  • 2,505
  • 2
  • 21
  • 31
5
votes
1 answer

I got an error when connect to 'www.google.com' use NSConnection

I get an error when connecting to 'www.google.com' using NSConnection. I cannot find the reason why. Any help will be appreciated. NSString *urkString = @"www.google.com"; NSURL *url = [NSURL URLWithString:urkString]; NSURLRequest *request =…
Jonathan
  • 403
  • 2
  • 7
  • 16
4
votes
1 answer

How to find the connection for a particular distributed objects method invocation?

I have a Cocoa client and server application that communicate using distributed objects implemented via NSSocketPorts and NSConnections in the standard way. The server vends a single object to the client applications, of which there may be several.…
OzBandit
  • 1,044
  • 7
  • 14
4
votes
3 answers

Cost of creating a new NSConnection on iPhone

Does anybody know how expensive a tcp connection is on iPhone? For example, if I have to download 8-10 small files (2-6 kB) from a web server does it make sense to create 8-10 NSConnection requests or would be better to make one request to download…
Dmytro
  • 2,522
  • 5
  • 27
  • 36
4
votes
0 answers

Objective-c simple polling

I'm new to objective-c and I'm building an app that requires a background polling to a generic API to refresh some data on my user interface. After several hours looking for an answer/example that fits my problem I came across some solutions like…
4
votes
1 answer

SOCKS Proxy connection in iOS App

How to Connect SOCKS Proxy connection in iOS I am able to connect successfully SOCKS Proxy Server via Simulator, when using System network setting. I have tried ASIHTTPRequest but Falied. Here my sample ASIHTTPRequest code NSURL *url = [NSURL…
Anurag Dixit
  • 119
  • 2
  • 16
3
votes
1 answer

Common NSConnection for various data proccessing from web server in iPhone

How to have common NSConnection for various data processing from web server in iPhone. If possible can I have code for it
sathish kumar
  • 1,061
  • 6
  • 16
  • 31
2
votes
1 answer

NSConnection - how to properly do "unvending" of an object?

For Mac OSX, I'm trying to use an NSConnection to proxy access of an object from one application instance to another on the same host. The relevant code is below. I can provide more if needed. Assume when I say "server", I'm referring to the…
selbie
  • 100,020
  • 15
  • 103
  • 173
2
votes
2 answers

Detecting/Repairing NSConnection failure

I would like to use NSConnection/NSDistributedObject for interprocess communication. I would like the client to be able to handle the case where the server is only occasionally reachable. How can I determine if sending a message to the NSConnection…
anthony
  • 40,424
  • 5
  • 55
  • 128
2
votes
1 answer

How do I do JSON lazy loading with NSConnection in XCode?

How do I do partial download of JSON Data using NSConnection ?
Nabil Sham
  • 2,305
  • 4
  • 26
  • 38
2
votes
0 answers

NSConnection throwing 303 error after large data POST

ERROR: Error Domain=kCFErrorDomainCFNetwork Code=303 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 303.)" UserInfo=0x1cd24f40 {NSErrorFailingURLKey=http://test.com/test/, NSErrorFailingURLStringKey=http://test.com/test/} I…
Ryan Detzel
  • 5,519
  • 9
  • 37
  • 49
2
votes
1 answer

iOS Best Practice for large Upload

I have an application that the user takes a series of pictures, these pictures than need to be uploaded to a server for their online account. At the moment, I am simply re sizing the images (still about 2mb an image) and uploading them 1 by 1. The…
msponagle
  • 330
  • 1
  • 11
1
2 3