Re: CFSocket
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>) |