[NKE]socket_receive
[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