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

MsnConnection Class Reference

#include <msnconnection.h>

Inheritance diagram for MsnConnection:

MsnNotificationConnection MsnSwitchboardConnection

List of all members.

Detailed Description

MSN server protocol implementation.

The class provides the following facilities:

Data from the basic I/O implementation is received by the dataReceived() slot. This method identifies the data and calls one of the following methods to deliver the message the a derived class:

These methods are implemented in the derived classes, to handle the action for every command.

To send protocol commands to the server, use:

Mike K. Bennett

Valerio Pilo <valerio@kmess.org>

Definition at line 66 of file msnconnection.h.


void disconnected ()
void pingSent ()
void statusMessage (QString message, bool isError)

Public Member Functions

bool isConnected () const
 Return whether or the socket is connected.
virtual ~MsnConnection ()
 The destructor.

Protected Types

 Ack type parameter for sendMimeMessage(). More...

Protected Slots

virtual void slotConnected ()=0
 Called when the connection attempt is successful.
virtual void slotError (QString error, MsnSocketBase::ErrorType type)=0
 Shows error dialog boxes.

Protected Member Functions

void addSoapClient (HttpSoapConnection *client)
 Internal function to track SOAP clients.
virtual void closeConnection ()=0
 Close the connection.
void connectToServer (const QString &server=QString(), const quint16 port=0)
 Connect to the given server via the socket.
void deleteSoapClient (HttpSoapConnection *client)
 Disconnect and delete a SOAP clients.
void deleteSoapClients ()
 Disconnect and delete all SOAP clients.
void disconnectFromServer (bool isTransfer=false)
 Disconnect from the server.
const QString getLocalIp () const
 Return the local IP address of the socket.
bool initialize ()
 Initialize the object.
bool isErrorCommand (const QString &command) const
 Return whether the given command is an error command.
virtual bool isPayloadCommand (const QString &command) const
 Return whether the given command is a payload command.
 MsnConnection (MsnSocketBase::ServerType serverType)
 The constructor.
virtual void parseCommand (const QStringList &command)=0
 Process a received command.
virtual void parseError (const QStringList &command, const QByteArray &payloadData)
 Process a received error command.
virtual void parseMimeMessage (const QStringList &command, const MimeMessage &message)=0
 Process a received MIME message.
void parseMultiPacketMimeMessage (const QStringList &command, const MimeMessage &mimeMessage)
virtual void parsePayloadMessage (const QStringList &command, const QByteArray &messageData)=0
 Process a received payload message.
int sendCommand (const QString &prefix, const QString &text="\r\n")
 Send a command to the server.
int sendMimeMessage (AckType ackType, const MimeMessage &message)
 Send a MIME message command to the server.
int sendPayloadMessage (const QString &prefix, const QString &arguments, const QByteArray &payload)
int sendPayloadMessage (const QString &prefix, const QString &arguments, const QString &payload)
void setAcceptedPayloadCommands (QStringList commandList)
void setSendPings (bool sendPings)
bool switchToHttpSocket ()
 If it is possible, switch to the HTTP connection.
bool switchToTcpSocket ()
 Switch back to the TCP connection.
void writeBinaryData (const QByteArray &data)
void writeData (const QString &data)

Private Slots

void slotDataReceived (const QStringList &commandLine, const QByteArray &payloadData)
 Called when data is received from the server.
void slotDisconnected ()
 Called when the socket is disconnected.

Private Member Functions

void attachToSocketSignals ()
 Connect a socket's signals to our slots.

Private Attributes

int ack_
bool initialized_
QHash< QString,
MultiPacketMessage * > 
QList< HttpSoapConnection * > soapClients_

Static Private Attributes

static bool useHttpSocket_


class KMessTest

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index