I have the same problem. Nowaday in Poco v1.7.3 this method (receiveFrame(Buffer)) is still not available. Was there any problem to include it to 1.7.x release?
I tried solve it with select() + ws.available(). Something like this:
Code: Select all
Poco::Net::Socket::select(readList, writeList, exceptList, Poco::Timespan(0, 300000));
unsigned int buffer_size = websocket.available();
char *buffer = new char[buffer_size]();
websocket.receiveFrame(buffer, buffer_size, flags);
This works on linux. However on Windows, if frame is larger than 8kB, websocket.available() returns always 8192
bytes, but receiveFrame throws WebSocket Exception: Insufficient buffer for payload size 73264
. Is there any difference in behaviour between implementation of available() on windows and on linux?
Is there any other way how to solve this problem? Will method receiveFrame(Buffer) be in next Poco release?