• 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: 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>)

  • Prev by Date: CFSocket
  • Next by Date: Re: How to get the Mac address of a host on LAN by its IP on MAC-OS-X
  • Previous by thread: CFSocket
  • Next by thread: New AFP?
  • Index(es):
    • Date
    • Thread