• 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
[NKE]socket_receive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NKE]socket_receive


  • Subject: [NKE]socket_receive
  • From: James Chan <email@hidden>
  • Date: Thu, 13 Mar 2008 13:42:24 +0800

Hi all,

I follow the document "Network Kernel Extensions Programming Guide" to trying create a kernel mode socket to send/receive data. I write a simple code like "Listing 2-1". Now, I can send out data with using "sock_send", but I can not receive data. (I can capture the respond packet from the network with Ethereal.)

I try to read data with using "sock_receivembuf" in the callback function, but it return EWOULDBLOCK.
After I got EWOULDBLOCK, I retry sock_receivembuf again, it still return EWOULDBLOCK.


After 5 seconds, I close the socket (sock_close), the callback function will be called twice.
The first time sock_receivembuf return 0, and the data length is correct.
The second time, sock_receivembuf return 0, length =0,


So, I confuse with the EWOULDBLOCK status.
If I retry , it still return EWOULDBLOCK status.
If I abort and return, there are no more callback function execute until I close socket.


Does anybody know the callback function will be trigger in what kind of condition??
How to handle the EWOULDBLOCK. status??



Regards, James Chan

--
James Chan
Software Engineer
Elitesilicon

_______________________________________________
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:
    • Re: [NKE]socket_receive
      • From: Terry Simons <email@hidden>
  • Prev by Date: Re: Kernel Extensions for iPhone
  • Next by Date: Re: [NKE]socket_receive
  • Previous by thread: Re: Kernel Extensions for iPhone
  • Next by thread: Re: [NKE]socket_receive
  • Index(es):
    • Date
    • Thread