Allow setting hostname

This commit is contained in:
Eric Frias 2014-08-21 16:14:08 -04:00
parent ed2f543c24
commit 156a7cc4b4
2 changed files with 8 additions and 8 deletions

View file

@ -2,6 +2,7 @@
#include <fc/crypto/ripemd160.hpp> #include <fc/crypto/ripemd160.hpp>
#include <fc/crypto/rand.hpp> #include <fc/crypto/rand.hpp>
#include <fc/optional.hpp> #include <fc/optional.hpp>
#include <fc/network/ip.hpp>
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -40,7 +41,7 @@ namespace fc
class gntp_notifier { class gntp_notifier {
public: public:
gntp_notifier(); gntp_notifier(const std::string& host_to_notify = "127.0.0.1", uint16_t port = 23053);
~gntp_notifier(); ~gntp_notifier();
void set_application_name(std::string application_name); void set_application_name(std::string application_name);
void set_application_icon(const gntp_icon_ptr& icon); void set_application_icon(const gntp_icon_ptr& icon);

View file

@ -41,7 +41,7 @@ namespace fc
class gntp_notifier_impl class gntp_notifier_impl
{ {
public: public:
gntp_notifier_impl(); gntp_notifier_impl(const std::string& host_to_notify = "127.0.0.1", uint16_t port = 23053);
// there's no API to change these right now, it will always notify localhost at the default GNTP port // there's no API to change these right now, it will always notify localhost at the default GNTP port
std::string hostname; std::string hostname;
@ -60,9 +60,9 @@ namespace fc
void send_gntp_message(const std::string& message); void send_gntp_message(const std::string& message);
}; };
gntp_notifier_impl::gntp_notifier_impl() : gntp_notifier_impl::gntp_notifier_impl(const std::string& host_to_notify /* = "127.0.0.1" */, uint16_t port /* = 23053 */ ) :
hostname("127.0.0.1"), hostname(host_to_notify),
port(23053), port(port),
connection_failed(false), connection_failed(false),
is_registered(false) is_registered(false)
{ {
@ -157,8 +157,8 @@ namespace fc
{ {
} }
gntp_notifier::gntp_notifier() : gntp_notifier::gntp_notifier(const std::string& host_to_notify /* = "127.0.0.1" */, uint16_t port /* = 23053 */ ) :
my(new detail::gntp_notifier_impl) my(new detail::gntp_notifier_impl(host_to_notify, port))
{ {
} }
@ -166,7 +166,6 @@ namespace fc
{ {
} }
void gntp_notifier::set_application_name(std::string appName) void gntp_notifier::set_application_name(std::string appName)
{ {
my->application_name = appName; my->application_name = appName;