ConnectionBytesUpdate
From TrillWiki
The connectionBytesUpdate function will update the bytes received and sent within a status window of a particular connection. Use this whenever new bytes are received or sent out to notify the user of activity.
Compatibility: 2.0 and higher
Contents |
Syntax
plugin_send(MYGUID, "connectionBytesUpdate", struct connection_bytes_t *);
Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.
Parameters
ConnectionBytesUpdate utilitizes the connection_bytes_t structure.
struct connection_bytes_t {
unsigned int struct_size;
char *medium;
int connection_id;
int sent_bytes_change;
int recv_bytes_change;
};
- medium
- The medium for this particular connection.
- connection_id
- A unique number representing the connection.
- sent_bytes_change
- The number of bytes most recently sent. This number will be added to the total bytes already sent.
- recv_bytes_change
- The number of bytes most recently received. This number will be added to the total bytes already received.
Return Value
Negative value on error, 0 on success.
Remarks
The bytes sent and received will automatically be reset when the connection goes from an offline to online status.
