Hello
I find some causes Acces Violation.
and usage 100% cpu if network is not avilable.
file SipXMediaLib/src/mp/NetInTask.cpp
//-----------------------------------------------
function int NetInTask::getWriteFD()
sLock.releaseRead();
- return mpWriteSocket->getSocketDescriptor();
+ if(mpWriteSocket)
+ return mpWriteSocket->getSocketDescriptor();
+ else return 0;
//---------------------------------------------
function int NetInTask::run(void *pNotUsed)
#endif /* DEBUG_BY_SUSPEND ] */
/* is it a request to modify the set of file descriptors? */
- if (FD_ISSET(mpReadSocket->getSocketDescriptor(), fds)) {
- numReady--;
- if (NET_TASK_MAX_MSG_LEN !=
- mpReadSocket->read((char *) &msg,
NET_TASK_MAX_MSG_LEN)) {
- osPrintf("NetInTask::run: Invalid request!\n");
- } else if (-2 == (int) msg.pRtpSocket) {
+ if (mpReadSocket && FD_ISSET(mpReadSocket->getSocketDescriptor(), fds)) {
+ numReady--;
+ if (NET_TASK_MAX_MSG_LEN !=
+ mpReadSocket->read((char *) &msg,
NET_TASK_MAX_MSG_LEN)) {
+ osPrintf("NetInTask::run: Invalid request!\n");
+ ::Sleep(100); //Not occur 100% cpu for example if
network is not available
+ } else if (-2 == (int) msg.pRtpSocket) {
//-------------------------------------
Piter
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/