outputting a buffer stream

I am simiply trying to display a message I receive from a tcp socket which terminates with "\r\n\r\n".

C++ however terminates immediately even though the server indicates that the message has been successfully transmitted.

        void handle_read( const boost::system::error_code& error, size_t bytes_transferred)
{
    std::istream response_stream(&response_);
    std::string incoming;
    std::string res_time = make_daytime_string();
    while (std::getline(response_stream, incoming) && incoming != "\r")
         std::cout << incoming << std::endl;
    std::cout <<"message received on "<< res_time <<std::endl;
}

In Eclipse I see the following in consol, (exit value = -1) When the program is terminated, If I switch to the consol of Linux I see the following error: * Error in `/home/administrator/Documents/eclipse/Projects/Asynchronous_TCP/Debug/Asynchronous_TCP': double free or corruption (!prev): 0x0000000001040580 *

Answers


Solved Apperantly I only needed to resolved the socket connection


Need Your Help

Due to SelectIO banking constraints, the IOBs in your design cannot be automatically placed

vhdl fpga xilinx

I'm using Spartan 3E starter kit. In creating a custom peripheral. I use the default settings except interfacing it to the PLB bus. I also generated XISE project. I added my ports which only consis...

FileNotFoundError: [Errno 2] No such file or directory

python file find

I am trying to open a CSV file but for some reason python cannot locate it.