Hi all,
I am working on wxWidgets 2.8.10 on windows platform. I have a peculiar problem with the sockets.
I have a server and two clients are connected to it.
If I make the first client BLOCKING, events like INPUT/LOST of the client two are no reaching server. And also the data which is sent from server is not reaching the client two.
If I make the client two as BLOCKING, the events related to client one is not reaching server.
Please help.
Regards
Johnnie
wxWidgets version : 2.8.10
Gcc versino : 4.5
Eclipse : Galelio
OS : windows XP service pack 3.
Events in Server scokets. Topic is solved
Events in Server scokets.
--johnniealan --
Hi all,
After lots of trail and errors I was able to resolve this issue.
Instead of BLOCKING (wxSOCKET_BLOCK) I used wxSOCKET_NOWAIT and handled the error WOULD_BLOCK. I changed the ReadMsg to Read and handled the errors.
Thanks for your help Auria
Regards
Johnnie
After lots of trail and errors I was able to resolve this issue.
Instead of BLOCKING (wxSOCKET_BLOCK) I used wxSOCKET_NOWAIT and handled the error WOULD_BLOCK. I changed the ReadMsg to Read and handled the errors.
Code: Select all
iCount=0;
while(iCount!= length)
{
pCurrentSock->Read((pucSockData + iCount) , length-iCount );
if (pCurrentSock-> Error() == TRUE)
{
if(wxSOCKET_TIMEDOUT != pCurrentSock->LastError()&& wxSOCKET_NOERROR !=pCurrentSock->LastError() )
{
continue ;
}
}
iCount +=pCurrentSock->LastCount();
}
Regards
Johnnie
--johnniealan --