void asio_multiplexer::assign_tcp_scribe(abstract_broker* self,
                                         connection_handle hdl) {
  std::lock_guard<std::mutex> lock(mtx_sockets_);
  auto itr = unassigned_sockets_.find(hdl.id());
  if (itr != unassigned_sockets_.end()) {
    add_tcp_scribe(self, std::move(itr->second));
    unassigned_sockets_.erase(itr);
  }
}
예제 #2
0
 inline bool invalid() const {
   return hdl.invalid();
 }
    data_packet receive_data()
    {
        std::call_once( connection_init_flag, &X::open_connection, this );
		return connection.receive_data();
	}
    void send_data(data_packet const& data)
    {
		/* c++11 에서는 std::call_once 대신 static 로컬 변수를 사용해도 thread safe 하게 한번만 초기화 된다. */
        std::call_once( connection_init_flag, &X::open_connection, this );
    	connection.send_data( data );
	}
예제 #5
0
 void send_data(data_packet const& data)
 {
     std::call_once(connection_init_flag, &X::open_connection, this);
     connection.send_data(data);
 }
예제 #6
0
void level1_connector::do_end_transaction(connection_handle const & handle, SQLSMALLINT completion_type) const
{
	auto const return_code = level1_api_->end_transaction(handle.type(), handle.handle, completion_type);
	impl::throw_on_error(return_code, *this, handle);
}
예제 #7
0
diagnostic_record level1_connector::do_get_diagnostic_record(connection_handle const & handle) const
{
	return impl::get_diagnostic_record(*level1_api_, handle.type(), handle.handle);
}