• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Kenny Millar <email@hidden>
  • Date: Thu, 04 Dec 2008 12:56:45 +0000

Hi everyone.

My app opens a telnet-like connection to a home automation device, and communicates with that device by sending and receiving short data packets.
In order to open an NSInputStream and NSOutput stream to the device at a known host address and port, I'm using code like this....

// Elsewhere in the code...
NSString          *hostAddr;
NSInputStream     *iStream;
NSOutputStream     *oStream;

...

// create the i/o streams
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,(CFStringRef)hostAddr,40 01,(CFReadStreamRef)&iStream,(CFWriteStreamRef)&oStream);
[iStream retain];
[oStream retain];

 
This is all good, and works very well for me.

The issue is that NSInputStream and NSOutputStream are supposed to be 'toll free bridged' to their CoreFoundation counterparts (CFReadStreamRef and CRWriteStreamRef). However when I build the code I always get these warnings:

    warning: passing argument 4 of 'CFStreamCreatePairWithSocketToHost' from incompatible pointer type.
    warning: passing argument 5 of 'CFStreamCreatePairWithSocketToHost' from incompatible pointer type.

Am I casting these calls wrongly or is there some other method I should use to open a telnet like socket based connection?
Like I say, the code actually works really well, I'd just love to get rid of the warnings.

Regards,
-Kenny
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CFStreamCreatePairWithSocketToHost
      • From: Quinn <email@hidden>
  • Prev by Date: Re: Overlapping requests on multiple persistent connections?
  • Next by Date: Re: CFStreamCreatePairWithSocketToHost
  • Previous by thread: Re: Overlapping requests on multiple persistent connections?
  • Next by thread: Re: CFStreamCreatePairWithSocketToHost
  • Index(es):
    • Date
    • Thread