diff options
-rw-r--r-- | client/sendrecieve.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/client/sendrecieve.cc b/client/sendrecieve.cc index 914b4af..8d6caf4 100644 --- a/client/sendrecieve.cc +++ b/client/sendrecieve.cc @@ -90,10 +90,11 @@ void SendRecieve::makeConnection(QDomDocument *xml_req) void SendRecieve::myTcpWrite(char *msg, int len) { - if(tcpConnected == TCP_CONNECTED) + if(tcpConnected == TCP_CONNECTED) { tcpsocket->write(msg, len); - else + } else { printf("TCP socket not initialized!\n"); + } } void SendRecieve::myHostFound() // slot @@ -120,11 +121,18 @@ void SendRecieve::myDisconnected() // slot has_result = true; } -void SendRecieve::myError(QAbstractSocket::SocketError) // slot +void SendRecieve::myError(QAbstractSocket::SocketError socketError) // slot { tcpConnected = TCP_ERROR; - QMessageBox::information(NULL, tr("Pracro"), tr("Couldn't connect to server.\nPlease contact a system administrator to resolve the problem.")); - exit(1); + printf("socket_error: %d\n", socketError); + switch (socketError) { + case 2 : + QMessageBox::information(NULL, tr("Pracro"), tr("Couldn't connect to server.\nPlease contact a system administrator to resolve the problem.")); + exit(1); + break; + default : + printf("default\n"); + } } void SendRecieve::myReadyReadHandler() |