Re: CFSocket
Re: CFSocket
- Subject: Re: CFSocket
- From: Quinn <email@hidden>
- Date: Wed, 24 Oct 2007 15:42:38 +0100
Title: Re: CFSocket
At 20:01 +0530 24/10/07, sunil prajapati wrote:
void acceptConnection(CFSocketRef socket,
CFSocketCallBackType type, CFDataRef address, const void *data, void
*info)
{
CFSocketContext context;
int *clientnum;
clientnum=calloc(1,sizeof(int));
*clientnum=gcount;
memset(&context, 0,
sizeof(context));
context.info = clientnum;
[...]
void receiveData(CFSocketRef child,
CFSocketCallBackType type, CFDataRef address, const void *data, void
*info)
The "info" parameter to your receiveData routine
corresponds to the "context.info" value you set up in
acceptConnection. You should initialise the data structure that
this points to with enough data for you to uniquely identify the
client. In this case you're just storing an index into the
clientconnected array, which seems sufficient to me.
S+E
--
Quinn "The
Eskimo!"
<http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core
OS/Hardware
_______________________________________________
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>) |