Re: Networking
Re: Networking
- Subject: Re: Networking
- From: Greg Guerin <email@hidden>
- Date: Tue, 14 Jul 2009 08:16:28 -0700
Christopher J Kemsley wrote:
What I want:
A custom written server on Device A that listens on The Port for a
device to connect. It expects to be sent an NSData object and will
be expected to return another NSData object.
Device B should be able to, through a blocking method (or
background in a thread), get an NSData object returned by Device A
after giving it another NSData object. (for example, Device B asks
Device A "Do I have messages?" and gets "Yes, you have two" in
response)
BLIP might work:
http://mooseyard.com/Jens/2008/05/blip-come-n-get-it/
I've tried setting up an HTTP server using NSSocketPort and
NSFileHandle's "acceptConnectionInBackgroundAndNotify" method;
however, I seem to be unable to get the client (regardless of
platform) to be able to send an arbitrary data package to it and
get one in return.
What do you mean by "arbitrary data package"? You can't just send
arbitrary binary data to an HTTP server and expect it to work. You
have to follow the HTTP protocol as defined in the relevant RFCs.
So, my question is, does anybody know of any other ways - or good
beginner's guides - to networking in situations like this?
The situation you've described is essentially creating an entire
custom network protocol. Creating custom network protocols is not
usually a task suitable for beginners.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden