Date: Thu, 19 Apr 2001 00:36:11 +0800 From: "Jessey" <r041102@ms17.hinet.net> To: <freebsd-net@FreeBSD.org> Subject: I call sosend occur error . The error code=22. Message-ID: <001a01c0c825$aee59300$f3fb1fa3@wen>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Dear Sir:
I call sosend occur error. The error code=22.
What wrong in my code?
The code follow:
socreate(); file://is ok;
|
}
top=m_get(MT_DATA,M_DONTWAIT);
if(top==NULL)
{
log(LOG_INFO, "top=NULL occur error\n");
goto out;
}
top->m_next=NULL;
top->m_nextpkt=NULL;
top->m_len=50;
adr=sizeof(struct m_hdr) +sizeof(int)+sizeof(struct ifnet *);
log(LOG_INFO, "adr= %d \n",adr);
top->m_data=top+adr;
log(LOG_INFO, "top= %x, top->m_data= %x,top+adr=%x \n",top
,top->m_data,top+adr);
top->m_type=MT_DATA;
top->m_flags=M_PKTHDR;
top->m_pkthdr.len=50;
top->m_pkthdr.rcvif=NULL;
log(LOG_INFO, "top= %x, Data= %x \n",top ,top->m_data);
error = sosend(so,(struct sockaddr *) &sin,NULL,top,
0,MSG_DONTROUTE);
Thanks/regards
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=big5" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Dear Sir:<BR>I call sosend occur error. The error
code=22.<BR>What wrong in my code?<BR><BR>The code follow:<BR><BR>socreate(); <A
href="file://is">file://is</A>
ok;<BR><BR>|<BR>}<BR><BR>top=m_get(MT_DATA,M_DONTWAIT);<BR><BR>
if(top==NULL)<BR>
{<BR> log(LOG_INFO, "top=NULL
occur error\n");<BR> goto
out;<BR> }<BR><BR>
top->m_next=NULL;<BR>
top->m_nextpkt=NULL;<BR>
top->m_len=50;<BR> adr=sizeof(struct m_hdr)
+sizeof(int)+sizeof(struct ifnet *);<BR> log(LOG_INFO,
"adr= %d \n",adr);<BR><BR>
top->m_data=top+adr;<BR> log(LOG_INFO, "top= %x,
top->m_data= %x,top+adr=%x \n",top
<BR>,top->m_data,top+adr);<BR><BR>
top->m_type=MT_DATA;<BR>
top->m_flags=M_PKTHDR;<BR>
top->m_pkthdr.len=50;<BR>
top->m_pkthdr.rcvif=NULL;<BR><BR><BR> log(LOG_INFO,
"top= %x, Data= %x \n",top ,top->m_data);<BR><BR>
error = sosend(so,(struct sockaddr *) &sin,NULL,top,
<BR>0,MSG_DONTROUTE);<BR><BR>Thanks/regards</FONT></DIV></BODY></HTML>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001a01c0c825$aee59300$f3fb1fa3>
