simplified dns (no self-made recursion); merge PingScheduler and PingRotate; make...
[pingcheck] / src / tcp / tcppinger.cpp
index 79347f6..1cd857d 100644 (file)
@@ -113,12 +113,11 @@ TcpPinger::~TcpPinger()
  * @return void.
  */
 void TcpPinger::ping(
-        const string &destination_ip,
+        const address &destination_ip,
         const uint16_t destination_port,
         function<void(bool)> ping_done_callback
 )
 {
-    BOOST_ASSERT( !destination_ip.empty() );
     BOOST_ASSERT( ( 0 < destination_port ) && ( destination_port < numeric_limits<uint16_t>::max() ) );
 
     PingDoneCallback = ping_done_callback;
@@ -159,17 +158,15 @@ uint16_t TcpPinger::get_destination_port() const
 }
 
 void TcpPinger::set_destination_endpoint(
-        const string &destination_ip,
+        const address &destination_ip,
         const uint16_t destination_port
 )
 {
-    BOOST_ASSERT( !destination_ip.empty() );
     BOOST_ASSERT( ( 0 < destination_port ) && ( destination_port < numeric_limits<uint16_t>::max() ) );
     BOOST_ASSERT( sizeof(uint16_t) <= sizeof(destination_port) );
 
-    address destination_address = address::from_string( destination_ip );
     uint16_t port = static_cast<uint16_t>( destination_port );
-    DestinationEndpoint = tcp_raw_protocol::endpoint( destination_address, port );
+    DestinationEndpoint = tcp_raw_protocol::endpoint( destination_ip, port );
 }
 
 void TcpPinger::start_send()