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

MsnFtpConnection Class Reference
[network/extra]

#include <msnftpconnection.h>

Inheritance diagram for MsnFtpConnection:

DirectConnectionBase

List of all members.


Detailed Description

The class for receiving and sending files. The MSNFTP protocol is used by old clients to transfer files. It's initiated by the FileTransfer class. Current clients use the direct-connection support of the P2PApplication invitations to transfer file data. The old file transfer support is still available in most clients for backwards compatibility.

Author:
Diederik van der Boor, Mike K. Bennett (original work).

Definition at line 45 of file msnftpconnection.h.


Public Types

enum  StatusType { STATUS_CHAT = 0, STATUS_DIALOG = 1, STATUS_CHAT_FAILED = 2, STATUS_DIALOG_FAILED = 3 }

Signals

void connectionAuthorized ()
void connectionClosed ()
void connectionEstablished ()
void connectionFailed ()
void statusMessage (KLocalizedString message, int statusType)
void statusMessage (QString message, int statusType)
void transferComplete ()
void transferFailed ()
void transferProgess (unsigned long bytesReceived)
void writeHandlerReady ()

Public Member Functions

void cancelTransfer (bool userCancelled=true)
void closeConnection ()
void connectWriteHandler (QObject *receiver, const char *slot)
void disconnectWriteHandler (QObject *receiver, const char *slot)
quint16 getLocalServerPort ()
QString getRemoteIp () const
quint16 getRemotePort () const
QString getSocketError () const
bool hasLastWriteFailed () const
bool hasTemporaryWriteError () const
bool hasTimedOut () const
virtual bool initialize ()
virtual bool isAuthorized () const
bool isConnected () const
bool isServer () const
bool isWriteHandlerConnected () const
 MsnFtpConnection (const QString authHandle, const QString authCookie)
bool openConnection (const QString &ipAddress, const quint16 port)
bool openServerPort ()
bool retrieveFile (QFile *outputFile, const QString &ipAddress, const quint16 port)
bool sendFile (QFile *inputFile)

Protected Member Functions

bool closeServerSocket ()
qint64 getAvailableBytes () const
QString getListeningServiceName () const
qint64 peekBlock (const qint64 size)
qint64 readBlock (QBuffer &buffer, const qint64 maxSize=0)
qint64 readBlock (QByteArray &buffer, const qint64 maxSize=0, const qint64 offset=0)
qint64 readBlock (char *buffer, const qint64 size)
void setAuthorized (bool authorized)
bool writeBlock (const QByteArray &block)
bool writeBlock (const char *block, const qint64 size)
 Write data to the socket.

Protected Attributes

QTime lastActivity_

Private Types

enum  Mode {
  WAIT = 0, SEND_VER = 1, SEND_USR = 2, SEND_TFR = 3,
  RECEIVE_DATA = 4, SEND_BYE = 5, WAIT_VER = 6, SEND_VER2 = 7,
  SEND_FIL = 8, WAIT_TFR = 9, SEND_DATA = 10, SEND_CANCEL = 11,
  SEND_CCL = 12
}

Private Slots

void slotConnectionEstablished ()
void slotConnectionFailed ()
void slotSocketDataReceived ()
void slotWriteData ()

Private Member Functions

void emitCancelStatusMessage (bool contactCancelled)
void parseCommand (const QStringList &command)
void parseReceivedFileData ()
void writeCancelData ()
void writeFileData ()
void writeMessage (QString message)

Private Attributes

QString authCookie_
QString authHandle_
qint64 fileBytesRemaining_
qint64 fileSize_
QIODevice * inputStream_
Mode mode_
QIODevice * outputStream_
qint64 remainingBlockBytes_
bool userCancelled_

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

Generated by  Doxygen 1.6.0   Back to index