Fixed a crash in client which happened if a server closed connection.

This commit is contained in:
miha_vitorovic
2011-01-07 13:29:00 +01:00
parent 3c03971939
commit 07712cc1f7
4 changed files with 27 additions and 17 deletions

View File

@@ -112,8 +112,7 @@ void testBlockingTCPSender() {
osiSockAddr srvAddr;
srvAddr.ia.sin_family = AF_INET;
//srvAddr.ia.sin_port = htons(CA_SERVER_PORT);
//srvAddr.ia.sin_family = AF_INET;
if(aToIPAddr("192.168.71.132", CA_SERVER_PORT, &srvAddr.ia)<0) {
cout<<"error in aToIPAddr(...)"<<endl;
return;
@@ -126,7 +125,10 @@ void testBlockingTCPSender() {
for(int i = 0; i<10; i++) {
cout<<" Message: "<<i+1<<endl;
transport->enqueueSendRequest(&dts);
if(!transport->isClosed())
transport->enqueueSendRequest(&dts);
else
break;
sleep(1);
}