mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +02:00
return statement to exit reading loop
Merges PR#2414 I used this example to start building my WebSocket application, however, I noticed that upon removing the echoing in the on_read method, the server repeatedly throws errors without exiting the method. You can recreate this problem by replacing the async_write with do_write and cause any error (i.e. client reloads the page). Adding a return statement here would make debugging for future changes much easier and it wouldn't harm the existing echoing in any way.
This commit is contained in:
@ -126,7 +126,7 @@ public:
|
||||
return;
|
||||
|
||||
if(ec)
|
||||
fail(ec, "read");
|
||||
return fail(ec, "read");
|
||||
|
||||
// Echo the message
|
||||
ws_.text(ws_.got_text());
|
||||
|
Reference in New Issue
Block a user