• 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
Re: Create a socket.io connection to node.js server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create a socket.io connection to node.js server


  • Subject: Re: Create a socket.io connection to node.js server
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 07 Dec 2012 10:30:50 -0800

On Dec 7, 2012, at 6:25 AM, Kévin Vavelin <email@hidden> wrote:

> I tried CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)@"neventy.fr", 80, &readStream, &writeStream);
>
> But it seems it doesn't work… I get 4 stream event (1 and 2)

That tells you the input and output streams are opening, and then opened. That’s good.

> and after 3 event I get stream event 2 and 4.

Sounds fine. 4 is kCFStreamStatusWriting which tells you you can write to the output stream without blocking. Are you writing anything? I don’t know how socket.io works, but it’s likely that the server is waiting for you to send it something before it will send you a response.

Apple has sample apps that show how to use CFStreams (and NSStreams) for TCP.

BTW, if you prefer using Objective-C you can simply case the CFStreamRefs returned by the Create call to NSInputStream* and NSOutputStream*, and then do everything else using the NSStream API.

—Jens
_______________________________________________

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


  • Follow-Ups:
    • Re: Create a socket.io connection to node.js server
      • From: Vavelin Kévin <email@hidden>
References: 
 >Create a socket.io connection to node.js server (From: Kévin Vavelin <email@hidden>)

  • Prev by Date: Re: leak in AVAudioPlayer ?
  • Next by Date: Help Book icon — retina?
  • Previous by thread: Create a socket.io connection to node.js server
  • Next by thread: Re: Create a socket.io connection to node.js server
  • Index(es):
    • Date
    • Thread