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

Re: WinSock to CFSocket problems


  • Subject: Re: WinSock to CFSocket problems
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 4 Apr 2005 17:19:06 -0700


On Apr 4, 2005, at 5:00 PM, Ken Baer wrote:

I am able to connect to the PC server from the Mac using BSD socket functions.  I am using CFSocketCreateWithNative() to get CFSocket from the BSD socket, and install a network event callback function.  In that function, I have the following code:


      case kCFSocketDataCallBack:

         event = FD_READ; 

         CFDataGetBytes( address, CFRangeMake(0,CFDataGetLength( address )), sockdata->m_ReceivedData );

         sockdata->m_AmountBuffered = CFDataGetLength( address );

         break;


The pointer sockdata->m_ReceivedData is allocated with the size 64 * 1024.  


The problem is that the data I am getting sent back is nothing like what the server is sending.  Here's what's happening.


The server is sending a stream of 27 bytes:

17 00 00 00 92 c1 77 41 fd 27 f0 84 3c 64 b4 7f  2b 23 28 a4 8f 69 f8 25 7e bc 1f


What I get in my buffer after the CFDataGetBytes() is 16 bytes:

10 02 03 85 c0 a8 01 7f 00 00 00 00 00 00 00 00



You are reading the address of the sender as if it were the data being sent.

Douglas Davidson

 _______________________________________________
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: 
 >WinSock to CFSocket problems (From: Ken Baer <email@hidden>)

  • Prev by Date: WinSock to CFSocket problems
  • Next by Date: Re: WinSock to CFSocket problems
  • Previous by thread: WinSock to CFSocket problems
  • Next by thread: Re: WinSock to CFSocket problems
  • Index(es):
    • Date
    • Thread