Skip to content

Commit 3edc21a

Browse files
committed
lwt: write_frame: flush output after write (fix #132)
1 parent 8fcfc56 commit 3edc21a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lwt/websocket_lwt_unix.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ let connect ?(extra_headers = Cohttp.Header.init ())
117117
Lwt.wrap2 (write_frame_to_buf ~mode:(Client random_string)) buf frame
118118
>>= fun () ->
119119
Lwt.catch
120-
(fun () -> Lwt_io.write oc (Buffer.contents buf))
120+
(fun () ->
121+
Lwt_io.write oc (Buffer.contents buf) >>= fun () -> Lwt_io.flush oc)
121122
(fun exn ->
122123
Lwt.async (fun () -> Lwt_io.close oc);
123124
Lwt.fail exn)

0 commit comments

Comments
 (0)