Skip to content

Commit

Permalink
lwt: write_frame: flush output after write (fix #132)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmithr committed Jan 2, 2023
1 parent 8fcfc56 commit 3edc21a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lwt/websocket_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ let connect ?(extra_headers = Cohttp.Header.init ())
Lwt.wrap2 (write_frame_to_buf ~mode:(Client random_string)) buf frame
>>= fun () ->
Lwt.catch
(fun () -> Lwt_io.write oc (Buffer.contents buf))
(fun () ->
Lwt_io.write oc (Buffer.contents buf) >>= fun () -> Lwt_io.flush oc)
(fun exn ->
Lwt.async (fun () -> Lwt_io.close oc);
Lwt.fail exn)
Expand Down

0 comments on commit 3edc21a

Please sign in to comment.