Logo Search packages:      
Sourcecode: gabber2 version File versions  Download package

Gabber::TCPTransmitter Class Reference

#include <TCPTransmitter.hh>

List of all members.


Detailed Description

Handles the actual network interaction

Definition at line 56 of file TCPTransmitter.hh.


Public Types

enum  Proxy {
  none, httpConnect, httpPut, httpPost,
  socks4, socks5
}

Public Member Functions

void connect (const string &host, guint port, bool use_ssl, bool autoreconnect)
void disconnect ()
guint getPort () const
const string getsockname ()
void listen (const string &host, guint port, bool raw=true)
void needSend (bool notify)
void send (const char *data)
void sendsz (const char *data, guint sz)
void setProxy (const string &ptype, const string &host, guint port, const string &user, const string &password, bool tryOther=true)
void startPoll ()

Public Attributes

SigC::Signal0< void > evtAccepted
SigC::Signal0< void > evtCanSendMore
SigC::Signal0< void > evtConnected
SigC::Signal2< void, const
char *, int > 
evtDataAvailable
SigC::Signal1< void, int > evtDataSent
SigC::Signal0< void > evtDisconnected
SigC::Signal1< void, const
string & > 
evtError
SigC::Signal0< void > evtReconnect
string dest_host
guint dest_port
bool failed_connect
bool failed_post
bool failed_put
bool failed_socks4
bool failed_socks5
string host
string password
guint port
guint response
string response_line
HandshakeState socks5_state
bool try_other
Proxy type
string user

Private Types

enum  HandshakeState { MethodsSent, AuthenticationSent, ConnectCmdSent }
enum  State {
  Offline, Connecting, Reconnecting, Connected,
  Listening, Accepting, Error, ProxyConnecting
}
enum  TransmitterError { errAddressLookup, errSocket }

Private Member Functions

void _async_connect ()
void _async_resolve (const gchar *hostname)
bool _gethostbyname (const gchar *hostname, struct in_addr *result)
void _send (send_data_buf *data)
const string getSocketError ()
void handleError (const string &emsg)
void handleError (const TransmitterError e)
void proxyHandleHttpHead ()
void proxyHandleSocks4Head ()
void proxyHandleSocks5AuthReply ()
void proxyHandleSocks5ConnectReply ()
void proxyHandleSocks5Head ()
void proxyHandleSocks5MethodReply ()
void proxyHandshakeIn (const char *buf, guint bytes_read)
void proxyHandshakeOut ()
void proxySendHead (const string &header)
void proxySendSocks5Auth ()
void proxySendSocks5Connect ()

Static Private Member Functions

static gboolean _connection_poll (gpointer data)
static string encodeBase64 (string text)
static gboolean on_host_resolved (GIOChannel *iochannel, GIOCondition cond, gpointer data)
static gboolean on_socket_accept (GIOChannel *iochannel, GIOCondition cond, gpointer data)
static gboolean on_socket_connect (GIOChannel *iochannel, GIOCondition cond, gpointer data)
static gboolean on_socket_event (GIOChannel *iochannel, GIOCondition cond, gpointer data)
static gboolean reconnect (gpointer data)

Private Attributes

bool _autoreconnect
struct sockaddr_in _host_sockaddr
bool _hostResolved
GIOChannel * _IOChannel
bool _is_raw
bool _need_send
guint _poll_eventid
guint _port
struct {
   string   dest_host
   guint   dest_port
   bool   failed_connect
   bool   failed_post
   bool   failed_put
   bool   failed_socks4
   bool   failed_socks5
   string   host
   string   password
   guint   port
   guint   response
   string   response_line
   HandshakeState   socks5_state
   bool   try_other
   Proxy   type
   string   user
_proxy
guint _reconnect_delay
guint _reconnect_timeoutid
GTimeVal * _reconnect_timeval
pid_t _resolver_pid
guint _resolver_watchid
guint _retries
guint _send_retry_eventid
std::list< send_data_buf * > _sendBuffer
gint _socket_flags
guint _socket_watchid
gint _socketfd
State _state
bool _use_ssl

Classes

struct  send_data_buf

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

Generated by  Doxygen 1.6.0   Back to index