From owner-freebsd-net Tue Apr 17 9:32:36 2001 Delivered-To: freebsd-net@freebsd.org Received: from ms17.hinet.net (ms17.hinet.net [168.95.4.17]) by hub.freebsd.org (Postfix) with ESMTP id 4941737B43C for ; Tue, 17 Apr 2001 09:32:26 -0700 (PDT) (envelope-from r041102@ms17.hinet.net) Received: from wen (h34.s243.ts31.hinet.net [163.31.243.34]) by ms17.hinet.net (8.8.8/8.8.8) with SMTP id AAA23948 for ; Wed, 18 Apr 2001 00:32:23 +0800 (CST) Message-ID: <001a01c0c825$aee59300$f3fb1fa3@wen> From: "Jessey" To: Subject: I call sosend occur error . The error code=22. Date: Thu, 19 Apr 2001 00:36:11 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0017_01C0C868.BBC9EA60" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_0017_01C0C868.BBC9EA60 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Dear Sir: I call sosend occur error. The error code=3D22. What wrong in my code? The code follow: socreate(); file://is ok; | } top=3Dm_get(MT_DATA,M_DONTWAIT); if(top=3D=3DNULL) { log(LOG_INFO, "top=3DNULL occur error\n"); goto out; } top->m_next=3DNULL; top->m_nextpkt=3DNULL; top->m_len=3D50; adr=3Dsizeof(struct m_hdr) +sizeof(int)+sizeof(struct ifnet *); log(LOG_INFO, "adr=3D %d \n",adr); top->m_data=3Dtop+adr; log(LOG_INFO, "top=3D %x, top->m_data=3D %x,top+adr=3D%x \n",top=20 ,top->m_data,top+adr); top->m_type=3DMT_DATA; top->m_flags=3DM_PKTHDR; top->m_pkthdr.len=3D50; top->m_pkthdr.rcvif=3DNULL; log(LOG_INFO, "top=3D %x, Data=3D %x \n",top ,top->m_data); error =3D sosend(so,(struct sockaddr *) &sin,NULL,top,=20 0,MSG_DONTROUTE); Thanks/regards ------=_NextPart_000_0017_01C0C868.BBC9EA60 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Dear Sir:
I call sosend occur error. The error=20 code=3D22.
What wrong in my code?

The code = follow:

socreate(); file://is=20 ok;

|
}

top=3Dm_get(MT_DATA,M_DONTWAIT);

 &n= bsp;  =20 if(top=3D=3DNULL)
    =20 {
         log(LOG_INFO, = "top=3DNULL=20 occur error\n");
         = goto=20 out;
     }

    =20 top->m_next=3DNULL;
    =20 top->m_nextpkt=3DNULL;
    =20 top->m_len=3D50;
     adr=3Dsizeof(struct = m_hdr)=20 +sizeof(int)+sizeof(struct ifnet *);
     = log(LOG_INFO,=20 "adr=3D %d \n",adr);

    =20 top->m_data=3Dtop+adr;
     log(LOG_INFO, = "top=3D %x,=20 top->m_data=3D %x,top+adr=3D%x \n",top=20
,top->m_data,top+adr);

    =20 top->m_type=3DMT_DATA;
    =20 top->m_flags=3DM_PKTHDR;
    =20 top->m_pkthdr.len=3D50;
    =20 top->m_pkthdr.rcvif=3DNULL;


     = log(LOG_INFO,=20 "top=3D %x, Data=3D %x \n",top = ,top->m_data);

    =20 error =3D sosend(so,(struct sockaddr *) &sin,NULL,top,=20
0,MSG_DONTROUTE);

Thanks/regards
------=_NextPart_000_0017_01C0C868.BBC9EA60-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message