• 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: CFSocket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFSocket


  • Subject: Re: CFSocket
  • From: Ben Artin <email@hidden>
  • Date: Thu, 22 Nov 2007 10:15:58 -0500

When I run client/server,client get connected with server but when I
send some data to client it does not receive by the client. I mean to
say  callback function "receiveData" is not called by CFSocket. This
problem is occur when I create the CFSocket on a thread as I have
given the source code below.  But when I create the CFSocket in a
normal function it works properly.

The issue here is not with threads, it's with the fact that you are not running the runloop.


What makes your "normal function" work is that someone is calling RunLoopRun on the main thread's runloop -- probably indirectly, via RunApplicationEveningLoop. In the threaded case, you install your socket on the thread's runloop and then you never run the runloop.

In short, call RunLoopRun() at the end of your thread function.

--

<http://artins.org/ben>

"It takes a great deal of bravery to stand up to our enemies,
but just as much to stand up to our friends" -- Albus Dumbledore

_______________________________________________
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


References: 
 >CFSocket (From: "sunil prajapati" <email@hidden>)
 >Re: CFSocket (From: Joseph Kelly <email@hidden>)
 >Re: CFSocket (From: "sunil prajapati" <email@hidden>)

  • Prev by Date: Re: CFSocket
  • Next by Date: Airport Framework / API
  • Previous by thread: Re: CFSocket
  • Next by thread: Re: CFSocket
  • Index(es):
    • Date
    • Thread