Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void MsnSocketTcp::slotSocketError ( QAbstractSocket::SocketError  errorCode  )  [private, slot]

Detect socket errors.

Closes the connection, and displays the "could not connect to the MSN Messenger service." message box.

Parameters:
errorCode The system error.

Definition at line 518 of file msnsockettcp.cpp.

References MsnSocketBase::ERROR_CONNECTING, MsnSocketBase::ERROR_DATA, MsnSocketBase::ERROR_DROP, and MsnSocketBase::ERROR_UNKNOWN.

Referenced by MsnSocketTcp().

{
#ifdef KMESSDEBUG_CONNECTION_SOCKET_TCP
  kWarning() << "Received error" << errorCode << "from the socket"
                "(socket state=" << socket_->state() << ").";
#endif

  ErrorType type;

  // Find the most appropriate kind of error to report
  switch( errorCode )
  {
    case QAbstractSocket::ConnectionRefusedError:
    case QAbstractSocket::HostNotFoundError:
      type = ERROR_CONNECTING;
      break;

    case QAbstractSocket::RemoteHostClosedError:
    case QAbstractSocket::NetworkError:
      type = ERROR_DROP;
      break;

    case QAbstractSocket::DatagramTooLargeError:
    case QAbstractSocket::UnknownSocketError:
      type = ERROR_DATA;
      break;

    default:
      type = ERROR_UNKNOWN;
      break;
  }

  // Ignore errors when disconnected: avoids duplicate error dialogs
  if( connected_ )
  {
    emit error( socket_->errorString(), type );
  }
}


Generated by  Doxygen 1.6.0   Back to index