gloox  0.9.9.12
Public Member Functions | List of all members
SIProfileFTHandler Class Reference

#include <siprofilefthandler.h>

Public Member Functions

virtual ~SIProfileFTHandler ()
virtual void handleFTRequest (const JID &from, const std::string &id, const std::string &sid, const std::string &name, long size, const std::string &hash, const std::string &date, const std::string &mimetype, const std::string &desc, int stypes, long offset, long length)=0
virtual void handleFTRequestError (Stanza *stanza, const std::string &sid)=0
virtual void handleFTSOCKS5Bytestream (SOCKS5Bytestream *s5b)=0

Detailed Description

An abstract base class to handle file transfer (FT) requests.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 33 of file siprofilefthandler.h.

Constructor & Destructor Documentation

virtual ~SIProfileFTHandler ( )
inlinevirtual

Virtual destructor.

Definition at line 40 of file siprofilefthandler.h.

Member Function Documentation

virtual void handleFTRequest ( const JID from,
const std::string &  id,
const std::string &  sid,
const std::string &  name,
long  size,
const std::string &  hash,
const std::string &  date,
const std::string &  mimetype,
const std::string &  desc,
int  stypes,
long  offset,
long  length 
)
pure virtual

This function is called to handle incoming file transfer requests, i.e. a remote entity requested to send a file to you. You should use either SIProfileFT::acceptFT() or SIProfileFT::declineFT() to accept or reject the request, respectively.

Parameters
fromThe file transfer requestor.
idThe request's id. This id MUST be supplied to either SIProfileFT::acceptFT() or SIProfileFT::declineFT().
sidThe requested stream's ID.
nameThe file name.
sizeThe file size.
hashThe file content's MD5 sum.
dateThe file's last modification time.
mimetypeThe file's mime-type.
descThe file's description.
stypesAn ORed list of SIProfileFT::StreamType indicating the StreamTypes the initiator supports.
offsetThe offset in bytes from which the file should be transmitted.
lengthThe number of bytes to send, starting from the given offset. A value of -1 indicates that the entire file is to be transmitted (taking the offset into account).
virtual void handleFTRequestError ( Stanza stanza,
const std::string &  sid 
)
pure virtual

This function is called to handle results of outgoing file transfer requests, i.e. you requested a stream (using SIProfileFT::requestFT()) to send a file to a remote entity.

Parameters
fromThe file transfer receiver.
sidThe stream ID. This function is called to handle a request error or decline.
stanzaThe complete error stanza.
sidThe request's SID.
virtual void handleFTSOCKS5Bytestream ( SOCKS5Bytestream s5b)
pure virtual

This function is called to pass a negotiated SOCKS5 bytestream. The bytestream is not yet open and not ready to send/receive data.

Note
To initialize the bytestream and to prepare it for data transfer do the following, preferable in that order:
  • register a SOCKS5BytestreamDataHandler with the SOCKS5Bytestream,
  • set up a separate thread for the bytestream or integrate it into your main loop,
  • call its connect() method and check the return value. To not block your application while the data transfer and/or the connection attempts last, you most likely want to put the bytestream into its own thread or process (before calling connect() on it). It is safe to do so without additional synchronization.
Parameters
s5bThe SOCKS5 bytestream.

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