sock_receive() returning error as EINVAL
sock_receive() returning error as EINVAL
- Subject: sock_receive() returning error as EINVAL
- From: sanjay yaragatti <email@hidden>
- Date: Mon, 11 Sep 2006 06:36:10 +0100 (BST)
Hi all,
I am writing a kernel mode driver for a modem.I am
using TCP implementation for the same. The API
sock_receive() and sock_receivembuf() are both
returning error no 22 i.e EINVAL (Invalid
argument).Can anyone please tell me the reason for the
same.. I am attaching the code below for reference..
Regards,
Sanjay
void socket_handler(socket_t so, void* context, int
waitf)
{
UCHAR recv_data[MTU_SIZE + 3];
int ret = 0;
struct msghdr recv_mesg;
struct iovec recv_iov;
size_t no_of_bytes_read = 0;
struct sockaddr from;
mbuf_t mp = 0;
do {
bzero(&from, sizeof(from));
bzero(&recv_mesg, sizeof(recv_mesg));
recv_mesg.msg_namelen = sizeof(from);
recv_mesg.msg_name = &from;
recv_iov.iov_base=(PUCHAR)recv_data;
recv_iov.iov_len=sizeof(recv_data);
recv_mesg.msg_iov=&recv_iov;
ret = sock_receivembuf(so, &recv_mesg, &mp,
MSG_DONTWAIT, &no_of_bytes_read) ;
if((ret !=0 && ret != 35 ))
{
IOLog("Receive failed,Error number is %d\n",ret);
return ;
}
if (no_of_bytes_read == 0)
{
sock_close(so);
}
if (no_of_bytes_read < 0)
{
EAL_ERR("Receive failed\n");
continue;
}
callback_func(context,recv_data, no_of_bytes_read);
if (mp == 0)
break;
}while (1);
}
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden