• 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
Get 0 bytes when receive raw ethernet packet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get 0 bytes when receive raw ethernet packet


  • Subject: Get 0 bytes when receive raw ethernet packet
  • From: Robin <email@hidden>
  • Date: Fri, 3 Nov 2006 17:06:03 +0800

Hi, all
I found my application sometimes get 0 bytes when I use recvfrom() to get raw ethernet packet from the Wireless network. I'm sure the target always send fixed bytes packets, I can use sniffer to catch the packet on the PC system.  it has no rules to get 0 bytes or fixed length bytes ( correct data), I do not know what happened. What else need I do? 

My receive data functions as this,

int _Receive_Data(UInt8 * buffer, UInt16 len)
{
int nRead =0;
unsigned int addrlen;
int nFlag = MSG_TRUNC;


if(((SESSION_INFO_STRUCT *)m_bEtherNetData->m_pSessionAudio)->options & CA_NONBLOCKING)
{
nFlag |= MSG_DONTWAIT;
}

addrlen = sizeof(m_bEtherNetData->saddr);
memset(&m_bEtherNetData->saddr,0, addrlen);


nRead = recvfrom(m_bEtherNetData->fd_recv, buffer, len, nFlag , &(m_bEtherNetData->saddr), &addrlen);

fprintf (stderr, "receive package OK,  get %d byetes ... \n", nRead);
return nRead;

}

Any one has any ideas about it? 

Thanks a lot!

Best regards,
Robin
 _______________________________________________
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

  • Follow-Ups:
    • Select not working on Mac
      • From: "Anand Thakur" <email@hidden>
  • Prev by Date: Re: Preventing a Network Service from becoming Primary
  • Next by Date: connecting through proxy
  • Previous by thread: Re: Preventing a Network Service from becoming Primary
  • Next by thread: Select not working on Mac
  • Index(es):
    • Date
    • Thread