Example #1
0
	/// Stop the processing threads and quit.
	virtual void quit()
	{
		if (_pmodel == pm_pipeline)
		{
			_callback_thread.request_stop();
			_callback_thread.join();
		}
		if (_pmodel != pm_coro)
			AsyncSocket<f8String>::quit();
	}
Example #2
0
	/*! Start the session - initiate the connection, logon and start heartbeating.
	  \param wait if true wait till session finishes before returning
	  \param send_seqnum next send seqnum
	  \param recv_seqnum next recv seqnum
	  \param davi default appl version id (FIXT) */
	virtual void start(bool wait, const unsigned send_seqnum=0, const unsigned recv_seqnum=0, const f8String davi=f8String())
	{
		_send_seqnum = send_seqnum;
		_recv_seqnum = recv_seqnum;
		if (!wait)
			_thread.start();
		else
			(*this)();
	}
Example #3
0
	/// Send a message to the processing method instructing it to quit.
	virtual void stop()
	{
		if (_pmodel == pm_pipeline)
		{
			const f8String from;
			_msg_queue.try_push(from);
			_callback_thread.request_stop();
		}
		if (_pmodel != pm_coro)
			AsyncSocket<f8String>::request_stop();
	}
Example #4
0
	/// Start the processing threads.
	virtual void start()
	{
		_socket_error = false;
		if (_pmodel != pm_coro)
			AsyncSocket<f8String>::start();
		if (_pmodel == pm_pipeline)
		{
			if (_callback_thread.start())
				_socket_error = true;
		}
	}
Example #5
0
	/*! Wait till processing thead has finished.
		 \return 0 on success */
	int join()
	{
		f8_scoped_lock guard(_mutex);
		if (_started)
		{
			_started = false;
			return _thread.join();
		}

		return 0;
	}
Example #6
0
	/// Start the processing thread.
	virtual void start()
	{
		f8_scoped_lock guard(_mutex);
		_started = true;
	 	_thread.start();
	}
Example #7
0
	/// Stop the processing thread and quit.
	virtual void quit() { _thread.request_stop(); join(); }
Example #8
0
	/// Start the processing thread.
	virtual void request_stop() { _thread.request_stop(); }
Example #9
0
	/// Dtor.
	virtual ~ReliableClientSession ()
	{
		_thread.request_stop();
		_thread.join();
	}