|
meanwhile 1.1.1
|
A file transfer is a simple way to get large chunks of binary data from one client to another. More...
#include "mw_common.h"Go to the source code of this file.
Data Structures | |
| struct | mwFileTransferHandler |
Macros | |
| #define | mwFileTransfer_cancel(ft) |
| cancel an open file transfer | |
| #define | mwFileTransfer_getSent(ft) |
| count of bytes sent/received over this file transfer so far | |
| #define | mwFileTransfer_isCancelLocal(ft) |
| #define | mwFileTransfer_isCancelRemote(ft) |
| #define | mwFileTransfer_isDone(ft) |
| #define | mwFileTransfer_isNew(ft) |
| #define | mwFileTransfer_isOpen(ft) |
| #define | mwFileTransfer_isPending(ft) |
| #define | mwFileTransfer_isState(ft, state) |
| #define | mwFileTransfer_reject(ft) |
| reject an incoming file transfer | |
| #define | mwService_FILE_TRANSFER 0x00000038 |
Enumerations | |
| enum | mwFileTranferCode { mwFileTransfer_SUCCESS = 0x00000000 , mwFileTransfer_REJECTED = 0x08000606 } |
| enum | mwFileTransferState { mwFileTransfer_NEW , mwFileTransfer_PENDING , mwFileTransfer_OPEN , mwFileTransfer_CANCEL_LOCAL , mwFileTransfer_CANCEL_REMOTE , mwFileTransfer_DONE , mwFileTransfer_ERROR , mwFileTransfer_UNKNOWN } |
Functions | |
| int | mwFileTransfer_accept (struct mwFileTransfer *ft) |
| accept an incoming file transfer | |
| int | mwFileTransfer_ack (struct mwFileTransfer *ft) |
| acknowledge the receipt of a chunk of data from an inbound file transfer. | |
| int | mwFileTransfer_close (struct mwFileTransfer *ft, guint32 code) |
| Close a file transfer. | |
| void | mwFileTransfer_free (struct mwFileTransfer *ft) |
| deallocate a file transfer. | |
| gpointer | mwFileTransfer_getClientData (struct mwFileTransfer *ft) |
| const char * | mwFileTransfer_getFileName (struct mwFileTransfer *ft) |
| the publicized file name. | |
| guint32 | mwFileTransfer_getFileSize (struct mwFileTransfer *ft) |
| total bytes intended to be sent/received | |
| const char * | mwFileTransfer_getMessage (struct mwFileTransfer *ft) |
| the message sent along with an offered file transfer | |
| guint32 | mwFileTransfer_getRemaining (struct mwFileTransfer *ft) |
| bytes remaining to be received/send | |
| struct mwServiceFileTransfer * | mwFileTransfer_getService (struct mwFileTransfer *ft) |
| enum mwFileTransferState | mwFileTransfer_getState (struct mwFileTransfer *ft) |
| the status of this file transfer | |
| const struct mwIdBlock * | mwFileTransfer_getUser (struct mwFileTransfer *ft) |
| the user on the other end of the file transfer | |
| struct mwFileTransfer * | mwFileTransfer_new (struct mwServiceFileTransfer *srvc, const struct mwIdBlock *who, const char *msg, const char *filename, guint32 filesize) |
| int | mwFileTransfer_offer (struct mwFileTransfer *ft) |
| initiate an outgoing file transfer | |
| void | mwFileTransfer_removeClientData (struct mwFileTransfer *ft) |
| int | mwFileTransfer_send (struct mwFileTransfer *ft, struct mwOpaque *data) |
| send a chunk of data over an outbound file transfer. | |
| void | mwFileTransfer_setClientData (struct mwFileTransfer *ft, gpointer data, GDestroyNotify clean) |
| struct mwFileTransferHandler * | mwServiceFileTransfer_getHandler (struct mwServiceFileTransfer *srvc) |
| const GList * | mwServiceFileTransfer_getTransfers (struct mwServiceFileTransfer *srvc) |
| struct mwServiceFileTransfer * | mwServiceFileTransfer_new (struct mwSession *session, struct mwFileTransferHandler *handler) |
A file transfer is a simple way to get large chunks of binary data from one client to another.
| #define mwFileTransfer_cancel | ( | ft | ) |
cancel an open file transfer
| #define mwFileTransfer_getSent | ( | ft | ) |
count of bytes sent/received over this file transfer so far
| #define mwFileTransfer_isCancelLocal | ( | ft | ) |
| #define mwFileTransfer_isCancelRemote | ( | ft | ) |
| #define mwFileTransfer_isDone | ( | ft | ) |
| #define mwFileTransfer_isNew | ( | ft | ) |
| #define mwFileTransfer_isOpen | ( | ft | ) |
| #define mwFileTransfer_isPending | ( | ft | ) |
| #define mwFileTransfer_isState | ( | ft, | |
| state ) |
| #define mwFileTransfer_reject | ( | ft | ) |
reject an incoming file transfer
| #define mwService_FILE_TRANSFER 0x00000038 |
| enum mwFileTranferCode |
| enum mwFileTransferState |
| int mwFileTransfer_accept | ( | struct mwFileTransfer * | ft | ) |
accept an incoming file transfer
References mwFileTransfer_accept().
Referenced by mwFileTransfer_accept().
| int mwFileTransfer_ack | ( | struct mwFileTransfer * | ft | ) |
acknowledge the receipt of a chunk of data from an inbound file transfer.
This should be done after every received chunk, or the transfer will stall. However, not all clients will wait for an ack after sending a chunk before sending the next chunk, so it is possible to have the handler's ft_recv function triggered again even if no ack was sent.
References mwFileTransfer_ack().
Referenced by mwFileTransfer_ack().
| int mwFileTransfer_close | ( | struct mwFileTransfer * | ft, |
| guint32 | code ) |
Close a file transfer.
This will trigger the ft_close function of the session's handler.
References mwFileTransfer_close().
Referenced by mwFileTransfer_close().
| void mwFileTransfer_free | ( | struct mwFileTransfer * | ft | ) |
deallocate a file transfer.
will call mwFileTransfer_close if necessary
References mwFileTransfer_free().
Referenced by mwFileTransfer_free().
| gpointer mwFileTransfer_getClientData | ( | struct mwFileTransfer * | ft | ) |
References mwFileTransfer_getClientData().
Referenced by mwFileTransfer_getClientData().
| const char * mwFileTransfer_getFileName | ( | struct mwFileTransfer * | ft | ) |
the publicized file name.
Not necessarily related to any actual file on either system
References mwFileTransfer_getFileName().
Referenced by mwFileTransfer_getFileName().
| guint32 mwFileTransfer_getFileSize | ( | struct mwFileTransfer * | ft | ) |
total bytes intended to be sent/received
References mwFileTransfer_getFileSize().
Referenced by mwFileTransfer_getFileSize().
| const char * mwFileTransfer_getMessage | ( | struct mwFileTransfer * | ft | ) |
the message sent along with an offered file transfer
References mwFileTransfer_getMessage().
Referenced by mwFileTransfer_getMessage().
| guint32 mwFileTransfer_getRemaining | ( | struct mwFileTransfer * | ft | ) |
bytes remaining to be received/send
References mwFileTransfer_getRemaining().
Referenced by mwFileTransfer_getRemaining().
| struct mwServiceFileTransfer * mwFileTransfer_getService | ( | struct mwFileTransfer * | ft | ) |
References mwFileTransfer_getService().
Referenced by mwFileTransfer_getService().
| enum mwFileTransferState mwFileTransfer_getState | ( | struct mwFileTransfer * | ft | ) |
the status of this file transfer
References mwFileTransfer_getState().
Referenced by mwFileTransfer_getState().
| const struct mwIdBlock * mwFileTransfer_getUser | ( | struct mwFileTransfer * | ft | ) |
the user on the other end of the file transfer
References mwFileTransfer_getUser().
Referenced by mwFileTransfer_getUser().
| struct mwFileTransfer * mwFileTransfer_new | ( | struct mwServiceFileTransfer * | srvc, |
| const struct mwIdBlock * | who, | ||
| const char * | msg, | ||
| const char * | filename, | ||
| guint32 | filesize ) |
References mwFileTransfer_new().
Referenced by mwFileTransfer_new().
| int mwFileTransfer_offer | ( | struct mwFileTransfer * | ft | ) |
initiate an outgoing file transfer
References mwFileTransfer_offer().
Referenced by mwFileTransfer_offer().
| void mwFileTransfer_removeClientData | ( | struct mwFileTransfer * | ft | ) |
References mwFileTransfer_removeClientData().
Referenced by mwFileTransfer_removeClientData().
| int mwFileTransfer_send | ( | struct mwFileTransfer * | ft, |
| struct mwOpaque * | data ) |
send a chunk of data over an outbound file transfer.
The client at the other end of the transfer should respond with an acknowledgement message, which can be caught in the service's handler.
References mwFileTransfer_send().
Referenced by mwFileTransfer_send().
| void mwFileTransfer_setClientData | ( | struct mwFileTransfer * | ft, |
| gpointer | data, | ||
| GDestroyNotify | clean ) |
References mwFileTransfer_setClientData().
Referenced by mwFileTransfer_setClientData().
| struct mwFileTransferHandler * mwServiceFileTransfer_getHandler | ( | struct mwServiceFileTransfer * | srvc | ) |
References mwServiceFileTransfer_getHandler().
Referenced by mwServiceFileTransfer_getHandler().
| const GList * mwServiceFileTransfer_getTransfers | ( | struct mwServiceFileTransfer * | srvc | ) |
References mwServiceFileTransfer_getTransfers().
Referenced by mwServiceFileTransfer_getTransfers().
| struct mwServiceFileTransfer * mwServiceFileTransfer_new | ( | struct mwSession * | session, |
| struct mwFileTransferHandler * | handler ) |
References mwServiceFileTransfer_new().
Referenced by mwServiceFileTransfer_new().