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

Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Attributes

pan::ScriptedSocket Class Reference

#include <socket-impl-scripted.h>

Inheritance diagram for pan::ScriptedSocket:
Inheritance graph
Collaboration diagram for pan::ScriptedSocket:
Collaboration graph

List of all members.

Public Types

typedef std::deque< std::string > strings_t

Public Member Functions

void add_script (const std::string &command, const strings_t &responses)
void add_script (const std::string &command, const std::string &response)
void clear ()
bool empty () const
virtual void get_host (std::string &setme) const =0
double get_speed_KiBps () const
bool is_abort_set () const
virtual bool open (const StringView &address, int port)
virtual bool open (const StringView &address, int port, std::string &setme_err)=0
void reset_speed_counter ()
void set_abort_flag (bool b)
virtual void write_command (const StringView &chars, Listener *)
void write_command_va (Listener *, const char *fmt,...)

Static Public Attributes

static const std::string ABORT
static const std::string NETWORK_ERROR

Protected Member Functions

void increment_xfer_byte_count (unsigned long byte_count)

Protected Attributes

bool _abort_flag
unsigned long _bytes_since_last_check
double _speed_KiBps
time_t _time_of_last_check

Private Types

typedef std::pair< std::string,
strings_t > 
typedef std::deque
< command_and_responses_t > 

Private Attributes

script_t _script

Detailed Description

A mock socket suitable for automated tests.

This object reads from a script and, if the commands passed to it match the script, it quotes back its lines from the script. If the commands don't match, it explodes.

Definition at line 35 of file socket-impl-scripted.h.

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

Generated by  Doxygen 1.6.0   Back to index