#pragma once

class StreamingClientDemo: public six::sixp::client::isession_events
{
public:
	StreamingClientDemo();
	~StreamingClientDemo(void);

	bool parse(int argc, char* argv[]);
	void run(void);


	virtual void on_error(six::sixp::client::isession *session,const six::sixp::client::server_settings &server,sixp_int32_t error_code,const char *error_message);
	virtual void on_connecting(six::sixp::client::isession *session,const six::sixp::client::server_settings &server,bool reconnecting);
	virtual void on_connected(six::sixp::client::isession *session,const six::sixp::client::server_settings &server,bool reconnected);
	virtual void on_disconnected(six::sixp::client::isession *session);
	virtual void on_timing_info(six::sixp::client::isession *session,sixp_uint64_t ping_turnaround_time,sixp_uint64_t estimated_delay_time,sixp_uint64_t queue_size);
	virtual void on_logged_out(six::sixp::client::isession *session,sixp_int32_t error_code,const char *error_message);

private:
	std::vector<std::string> split(const std::string &s, char delim, std::vector<std::string> &elems);
	std::vector<std::string> split(const std::string &s, char delim);
	bool parseOneQuote(std::vector<std::string> &params,std::string &prl);
	bool parseOneOrder(std::vector<std::string> &params,std::string &prl);
	bool parseFile(std::string filename, std::vector<std::string> &prls);

	std::string m_server;
	std::string m_userid;
	std::string m_pwd;
	std::vector<std::string> m_prls;
	MyLogger m_logger;
	std::map<sixp_uint64_t,DataListener*> m_dataListeners;



};