File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,13 @@ let client ?(name = "websocket.client") ?(extra_headers = Header.init ())
95
95
>> = fun () -> forward_frames_to_app ws_to_app
96
96
in
97
97
let forward_frames_to_net ws_to_net app_to_ws =
98
- Writer. transfer ws_to_net app_to_ws (fun fr ->
99
- Buffer. clear buf;
100
- write_frame_to_buf ~mode: (Client random_string) buf fr;
101
- let contents = Buffer. contents buf in
102
- Writer. write ws_to_net contents)
98
+ Writer. transfer' ws_to_net app_to_ws (fun frs ->
99
+ Queue. iter frs ~f: (fun fr ->
100
+ Buffer. clear buf;
101
+ write_frame_to_buf ~mode: (Client random_string) buf fr;
102
+ let contents = Buffer. contents buf in
103
+ Writer. write ws_to_net contents);
104
+ Writer. flushed ws_to_net)
103
105
in
104
106
Deferred. any_unit
105
107
[
@@ -350,7 +352,7 @@ let upgrade_connection ?(select_protocol = fun _ -> None)
350
352
| true -> Deferred. unit
351
353
| false ->
352
354
Writer. write writer ping_frame_string;
353
- ping_loop ()
355
+ Writer. flushed writer >> = fun () -> ping_loop ()
354
356
in
355
357
ping_loop ()
356
358
in
You can’t perform that action at this time.
0 commit comments