c++ - Poco::Net library hangs on output of Poco::Net::SocketStream -


By going to slide, I wrote nearly one program similar to their first net example.

  #include & lt; Iostream & gt; # Include & lt; Cstdlib & gt; # Include & lt; Poco / Net / SocketAddress.h & gt; # Include & lt; Poco / Net / StreamSocket.h & gt; # Include & lt; Poco / Net / SocketStream.h & gt; # Include & lt; Poco / StreamCopier.h> Int main (int argc, char ** argv) {Poco :: Net :: SocketAddress socket_address ("www.google.com", 80); Poco :: Net :: StreamSocket stream_socket (socket_address); Poco :: Net :: SocketStream socket_stream (stream_socket); Socket_stream & lt; & Lt; "GET / HTTP / 1.1 \ r \ n" "Host: www.google.com \ r \ n" "\ r \ n"; Socket_stream.flush (); Poké :: StreamCopier :: copyStream (socket_stream, std :: court); Return EXIT_SUCCESS; }   

The copystream function outputs some data, and then hangs up. How do I get the rest of the data?

Instead use Poco :: Net :: DialogSocket.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -