[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/14: controlport: android: cleaning up; b
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/14: controlport: android: cleaning up; better logs; help to support android. |
Date: |
Wed, 6 May 2015 21:31:03 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit f3743ffacf7a35d8f18f6b2fb7955bb339363e6b
Author: Tom Rondeau <address@hidden>
Date: Tue May 5 10:10:19 2015 -0400
controlport: android: cleaning up; better logs; help to support android.
---
.../include/gnuradio/thrift_application_base.h | 6 +-
.../include/gnuradio/thrift_server_template.h | 64 ++++++++++++----------
.../controlport/thrift/rpcserver_booter_thrift.cc | 2 +-
3 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index 4af5e88..33b8437 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -197,14 +197,11 @@ thrift_application_base<TserverBase,
TserverClass>::thrift_application_base(Tser
{
gr::configure_default_loggers(d_logger, d_debug_logger, "controlport");
d_application = _app;
- //GR_LOG_DEBUG(d_debug_logger, "thrift_application_base: ctor");
}
template<typename TserverBase, typename TserverClass>
void thrift_application_base<TserverBase, TserverClass>::start_application()
{
- //std::cerr << "thrift_application_base: start_application" << std::endl;
-
unsigned int max_init_attempts = \
static_cast<unsigned int>(gr::prefs::singleton()->get_long("thrift",
"init_attempts",
d_default_max_init_attempts));
@@ -220,7 +217,8 @@ void thrift_application_base<TserverBase,
TserverClass>::start_application()
}
if(!app_started) {
- std::cerr << "thrift_application_base::start_application(), timeout
waiting to port number might have failed?" << std::endl;
+ GR_WARN("thrift", "thrift_application_base::start_application(), "
+ "timeout waiting to port number might have failed?");
}
p_impl->d_application_initilized = true;
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index b8f5448..e2d6f63 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -80,13 +80,13 @@ private:
};
template<typename TserverBase, typename TserverClass, typename TImplClass>
-thrift_server_template<TserverBase, TserverClass,
TImplClass>::thrift_server_template
-(TImplClass* _this) : thrift_application_base<TserverBase, TImplClass>(_this),
-d_handler(new TserverClass()),
-d_processor(new GNURadio::ControlPortProcessor(d_handler)),
-d_serverTransport(),
-d_transportFactory(),
-d_protocolFactory(new thrift::protocol::TBinaryProtocolFactory())
+thrift_server_template<TserverBase, TserverClass,
TImplClass>::thrift_server_template(TImplClass* _this)
+ : thrift_application_base<TserverBase, TImplClass>(_this),
+ d_handler(new TserverClass()),
+ d_processor(new GNURadio::ControlPortProcessor(d_handler)),
+ d_serverTransport(),
+ d_transportFactory(),
+ d_protocolFactory(new thrift::protocol::TBinaryProtocolFactory())
{
gr::logger_ptr logger, debug_logger;
gr::configure_default_loggers(logger, debug_logger, "controlport");
@@ -101,39 +101,45 @@ d_protocolFactory(new
thrift::protocol::TBinaryProtocolFactory())
// Collect configuration options from the Thrift config file;
// defaults if the config file doesn't exist or list the specific
// options.
- port = static_cast<unsigned int>(gr::prefs::singleton()->get_long("thrift",
"port",
-
thrift_application_base<TserverBase, TImplClass>::d_default_thrift_port));
- nthreads = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "nthreads",
-
thrift_application_base<TserverBase,
TImplClass>::d_default_num_thrift_threads));
- buffersize = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "buffersize",
-
thrift_application_base<TserverBase,
TImplClass>::d_default_thrift_buffer_size));
+ port = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "port",
+ thrift_application_base<TserverBase,
+ TImplClass>::d_default_thrift_port));
+ nthreads = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "nthreads",
+ thrift_application_base<TserverBase,
+
TImplClass>::d_default_num_thrift_threads));
+ buffersize = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "buffersize",
+ thrift_application_base<TserverBase,
+
TImplClass>::d_default_thrift_buffer_size));
d_serverTransport.reset(new thrift::transport::TServerSocket(port));
d_transportFactory.reset(new
thrift_server_template::TBufferedTransportFactory(buffersize));
-
if(nthreads <= 1) {
- // "Thrift: Single-threaded server"
- //std::cout << "Thrift Single-threaded server" << std::endl;
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset(
- new thrift::server::TSimpleServer(d_processor, d_serverTransport,
d_transportFactory, d_protocolFactory));
+ // "Thrift: Single-threaded server"
+ //std::cout << "Thrift Single-threaded server" << std::endl;
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset
+ (new thrift::server::TSimpleServer(d_processor, d_serverTransport,
+ d_transportFactory,
d_protocolFactory));
}
else {
- //std::cout << "Thrift Multi-threaded server : " << d_nthreads <<
std::endl;
- boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager(
-
thrift::concurrency::ThreadManager::newSimpleThreadManager(nthreads));
+ //std::cout << "Thrift Multi-threaded server : " << d_nthreads <<
std::endl;
+ boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager
+ (thrift::concurrency::ThreadManager::newSimpleThreadManager(nthreads));
- threadManager->threadFactory(
- boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>(
- new thrift::concurrency::PlatformThreadFactory()));
+ threadManager->threadFactory
+ (boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>
+ (new thrift::concurrency::PlatformThreadFactory()));
- threadManager->start();
+ threadManager->start();
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset(
- new thrift::server::TThreadPoolServer(d_processor, d_serverTransport,
- d_transportFactory,
d_protocolFactory,
- threadManager));
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset
+ (new thrift::server::TThreadPoolServer(d_processor, d_serverTransport,
+ d_transportFactory,
d_protocolFactory,
+ threadManager));
}
}
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
index 1d6cafe..3284fa0 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
@@ -124,7 +124,7 @@ bool thrift_application_base<rpcserver_base,
rpcserver_booter_thrift>::applicati
set_endpoint(endpoint);
- GR_LOG_INFO(d_logger, "Apache Thrift: " + endpoint);
+ GR_INFO("thrift_application_base", "Apache Thrift: " + endpoint);
d_thirft_is_running = true;
result = true;
}
- [Commit-gnuradio] [gnuradio] 01/14: Print scan rate, (continued)
- [Commit-gnuradio] [gnuradio] 01/14: Print scan rate, git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 08/14: controlport: this fixes a complaint by newer versions of Boost., git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 06/14: controlport: fixing complaints about no non-virtual dtor., git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 09/14: Merge branch 'maint', git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 02/14: uhd: Fixes for CID 1296559 and 1090067 and more, git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 05/14: controlport: build: allowing ControlPort and probes in static builds., git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 04/14: uhd: Updated frequency hopping example to do DSP tuning only, git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 12/14: Merge remote-tracking branch 'mbant/uhd/cids-59-67-master', git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 10/14: Merge remote-tracking branch 'ckuethe/spectrum_sense', git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 11/14: Merge remote-tracking branch 'trondeau/controlport/cleaning_up', git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 07/14: controlport: android: cleaning up; better logs; help to support android.,
git <=
- [Commit-gnuradio] [gnuradio] 13/14: Merge remote-tracking branch 'mbant/uhd/message_updates', git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 14/14: uhd: changing uhd_msg_tune example to use other forms of setting parameters., git, 2015/05/06
- [Commit-gnuradio] [gnuradio] 03/14: uhd: Updated command interface to match new message command format, git, 2015/05/06