Hi,
This post relates to the following tutrial: http://appinf.com/poco/wiki/tiki-index.php?page=tutorialtcpsockets
I am trying to copy an input stream from a StreamSocket into std::cout.
ReceiveBytes works fine but StreamCopier::copyStream fails.
I am sending a string from a SocketServer and need to receive the string at the client side using a socket.
On the client side I first open a socket and connect to the socket server succesfully:
SocketAddress sa(svsHost, svsPort);.
StreamSocket ss1(sa);.
Calling the following code succeeds:
char buffer[256];
int numBytesReceived = ss1.receiveBytes(buffer, sizeof(buffer));
But the next following code fails:
SocketInputStream strIn(ss1);
"int numBytesCopied = StreamCopier::copyStream(strIn, std::cout);"
The value of the returned numBytesCopied is 0
Any ideas?
Thanks,
Avner





