#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
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
-
from | The file transfer requestor. |
id | The request's id. This id MUST be supplied to either SIProfileFT::acceptFT() or SIProfileFT::declineFT(). |
sid | The requested stream's ID. |
name | The file name. |
size | The file size. |
hash | The file content's MD5 sum. |
date | The file's last modification time. |
mimetype | The file's mime-type. |
desc | The file's description. |
stypes | An ORed list of SIProfileFT::StreamType indicating the StreamTypes the initiator supports. |
offset | The offset in bytes from which the file should be transmitted. |
length | The 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
-
from | The file transfer receiver. |
sid | The stream ID. This function is called to handle a request error or decline. |
stanza | The complete error stanza. |
sid | The request's SID. |
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
-
s5b | The SOCKS5 bytestream. |
The documentation for this class was generated from the following file: