From: Guilherme Maciel Ferreira Date: Tue, 2 Aug 2011 10:12:57 +0000 (-0300) Subject: Move the ACK segment send functionality to the send_ack_request() method X-Git-Tag: v1.1^2~35 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b594b7d95a02467863f2c6ba10c4a995ab978edd;p=pingcheck Move the ACK segment send functionality to the send_ack_request() method --- diff --git a/src/tcp/tcppinger.cpp b/src/tcp/tcppinger.cpp index 01c5fa3..6b6a5eb 100644 --- a/src/tcp/tcppinger.cpp +++ b/src/tcp/tcppinger.cpp @@ -170,12 +170,16 @@ void TcpPinger::start_send() ); tcp_header.checksum( cksum ); + send_ack_request( tcp_header ); +} + +void TcpPinger::send_ack_request( const TcpHeader &tcp_header ) +{ // Encode the request packet. boost::asio::streambuf request_buffer; ostream os( &request_buffer ); os << tcp_header; - // Send the request. TimeSent = microsec_clock::universal_time(); string dest_address_string = DestinationEndpoint.address().to_string(); @@ -199,6 +203,7 @@ void TcpPinger::start_send() << ex.what() << endl; } + // Tell how long to wait for the reply schedule_timeout_rst_reply(); } diff --git a/src/tcp/tcppinger.h b/src/tcp/tcppinger.h index e2ae498..f1babc1 100644 --- a/src/tcp/tcppinger.h +++ b/src/tcp/tcppinger.h @@ -73,6 +73,7 @@ private: const uint16_t destination_port, const uint16_t sequence_number ) const; + void send_ack_request( const TcpHeader &tcp_header ); void schedule_timeout_rst_reply(); void handle_timeout();