[OpenSIPStack] Problem with last change in SIPUDPTransport::ReadPacket()
Brought to you by:
joegenbaclor
From: Gustavo C. <cur...@ho...> - 2007-07-25 14:58:31
|
Hi Joegen: =20 I have a problem with the last change in SIPUDPTransport::ReadPacket(): =20 if( length =3D=3D 0 ) { packet.SetSize(0); return TRUE; ----> return FALSE; } =20 when SIPUDPTransport::ReadPacket() return false, SIPTransport::ProcessRead(= ) also return false and=20 SIPTransport::ReadThread::Main() finish and no more sip messages are proces= sed. =20 when I debugged SIPUDPSocketList::ReadFrom(), i found this: =20 BOOL SIPUDPSocketList::ReadFrom() BOOL ok =3D socket.ReadFrom( bytes, len, = addr, port ) --> len =3D 2048, addr =3D 127.0.0.1, port =3D 38890 if (os_r= ecvfrom(buf, len, 0, sa, &size)) int recvResult =3D ::recvfrom(os_handle= , (char *)buf, len, flags, from, fromlen); if (!ConvertOSError(recvResult= , LastReadError))--> recvResult =3D -1, LastReadError =3D 0 BOOL ok =3D = ConvertOSError(status, lastError, osError); return PChannel::ConvertOSE= rror(-2, lastError, osError); osError =3D GetLastError(); (osError =3D= 10054 =3D WSAECONNRESET) (Connection reset by peer) osError |=3D PWIN= 32ErrorFlag; (osError =3D 1073751878) lastError =3D Miscellaneous; (la= stError =3D 12) return lastReadCount > 0; (lastReadCount =3D 0) LOG( LogE= rror(), "UDP Socket Read Error (" << socket.GetErrorText() << ")" ); PStr= ing PChannel::GetErrorText(Errors lastError, int osError) (lastError =3D 12= ) (osError =3D 1073751881) DWORD err =3D osError & ~PWIN32ErrorFlag; (err= =3D 10057 =3D WSAENOTCONN) (Socket not connected) 49:28:50.887 ERR: [CID= =3D0x0000] UDP Socket Read Error (Socket not connected) bytesRead =3D 0; re= turn TRUE; /// return TRUE here. error in ReadFrom is benign I don't understand why the errors are differents, but when I searched for t= he original error (10054), i found this: =20 "If sending a datagram using the sendto function results in an "ICMP port u= nreachable" response and the select function is set for readfds, the progra= m returns 1 and the subsequent call to the recvfrom function does not work = with a WSAECONNRESET (10054) error response" =20 Maybe some ICMP validation go wrong with winsock. I attach a log.=20 =20 Thanks for your help. =20 Gustavo =20 _________________________________________________________________ Descubre Live.com - tu propia p=E1gina de inicio, personalizada para ver r= =E1pidamente todo lo que te interesa en un mismo sitio. http://www.live.com/getstarted= |