Bug#118746: libtcp4u3-dev: UdpRecv does never return successfully
Package: libtcp4u3-dev
Version: N/A
Severity: normal
Hi!
If you want to see if a udp-datagram was recieved, you'll have to get the
returnvalue of the recv-call. UdpRecv always returns -2 which is the
select-timeout notice. If you take a look at the function:
int InternalUdpRecv (LPUDPSOCK pUdp, LPSTR sData, int nDataSize,
unsigned uTimeOut, HFILE hLogFile)
[...]
Rc = recvfrom (pUdp->UdpSock, sData, nDataSize, 0,
(struct sockaddr far *) & pUdp->saRecvAddr, & Len);
if (Rc<0)
{
Tcp4uLog (LOG4U_ERROR, "recvfrom");
return TCP4U_ERROR;
}
}
while ( pUdp->bSemiConnected
[...]
It should read:
Rc = recvfrom (pUdp->UdpSock, sData, nDataSize, 0,
(struct sockaddr far *) & pUdp->saRecvAddr, & Len);
if (Rc<0)
{
Tcp4uLog (LOG4U_ERROR, "recvfrom");
return TCP4U_ERROR;
} else { // Success -- datagram recieved.
return Rc;
}
With this patch you can get a successfull UDP-Datagram.
Bye, Nils
-- System Information
Debian Release: testing/unstable
Kernel Version: Linux voyager 2.4.13-pre6 #8 Mon Oct 22 16:08:07 CEST 2001 i686 unknown
Reply to: