#include <channel.h>
Public Member Functions | |
| channel (int channeltype, long time) | |
| initiate a new channel, 1=socket based, 2=file based (also give file size), 3=server_socker, 4=import based | |
| void | close (void) |
| Free the buffers of this channel. | |
| bool | next () |
| Scan for the next key in the input. | |
| bool | peek (string key) |
| Check if the next key in the input is the given key. | |
| void | write (const std::string key, const std::string value) |
| Write this key to the other side of the connection or the file. | |
| void | write (const std::string key, const long value) |
| Write this numeric key to the other side of the connection or the file. | |
| void | send () |
| Send the finished data to the other side. | |
| void | fread (const std::string file) |
| Read data from this file. | |
| void | fwrite (const std::string file) |
| Write the next data to this file. | |
| void | finish () |
| Finish writing to the file or close the socket. | |
| void | poll (long time) |
| Poll for new data, with the current time. | |
| void | send_session (long time) |
| Send session data to the other party. | |
Public Attributes | |
| void * | payload |
| payload of this channel | |
| std::string | key |
| Pointer to the current key. | |
| std::string | value |
| Pointer to the current value. | |
| std::string | ip |
| Ip address of the connected client or the hostname of the server. | |
| int | port |
| Port number on the server. | |
| unsigned int | id |
| Unique id for the channel. | |
| connection * | stream |
| bool | finished |
| sigc::signal< void, channel * > | handler |
| Function to call when new data is ready to read. | |
| int | type |
| type of the connection (1=client_socket, 2=file, 3=server_socket, 4=import) | |
| class communicate * | comm |
| related communication record | |
| bool | lock |
| lock till correct credentials are found | |
| channel::channel | ( | int | channeltype, | |
| long | time | |||
| ) |
initiate a new channel, 1=socket based, 2=file based (also give file size), 3=server_socker, 4=import based
| void channel::close | ( | void | ) |
Free the buffers of this channel.
| bool channel::next | ( | void | ) |
Scan for the next key in the input.
| bool channel::peek | ( | string | key | ) |
Check if the next key in the input is the given key.
| void channel::write | ( | const std::string | key, | |
| const std::string | value | |||
| ) |
Write this key to the other side of the connection or the file.
| void channel::write | ( | const std::string | key, | |
| const long | value | |||
| ) |
Write this numeric key to the other side of the connection or the file.
| void channel::send | ( | ) |
Send the finished data to the other side.
| void channel::fread | ( | const std::string | file | ) |
Read data from this file.
| void channel::fwrite | ( | const std::string | file | ) |
Write the next data to this file.
| void channel::finish | ( | ) |
Finish writing to the file or close the socket.
| void channel::poll | ( | long | time | ) |
Poll for new data, with the current time.
Scan this channel for input.
| void channel::send_session | ( | long | time | ) |
Send session data to the other party.
| void* channel::payload |
payload of this channel
| std::string channel::key |
Pointer to the current key.
| std::string channel::value |
Pointer to the current value.
| std::string channel::ip |
Ip address of the connected client or the hostname of the server.
| int channel::port |
Port number on the server.
| unsigned int channel::id |
Unique id for the channel.
Connection class with read/write/close functions Dont change connection type on a running channel
| bool channel::finished |
Indication that the channel is finished, only needed for communicate class Use finish() to indicate it is finished
| sigc::signal<void, channel*> channel::handler |
Function to call when new data is ready to read.
| int channel::type |
type of the connection (1=client_socket, 2=file, 3=server_socket, 4=import)
| class communicate* channel::comm |
related communication record
| bool channel::lock |
lock till correct credentials are found
Visit the project page on