File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ let t_receivefd fd =
77 let nb_read, remote_saddr, fd_recv = recv_fd fd buf 0 2 [] in
88 Printf. printf " [receiver] Received %d bytes, received fd = %d\n %!" nb_read (int_of_fd fd_recv);
99 let message = " [receiver] I'm the receiver, and I'm writing into the fd you passed to me :p\n " in
10- let nb_written = write fd_recv ( Bytes. unsafe_of_string message) 0 (String. length message) in
10+ let nb_written = write_substring fd_recv message 0 (String. length message) in
1111 assert (nb_written = String. length message)
1212
1313let t_sendfd fd =
1414 let fd_to_send = stdout in
15- let buf = Bytes. of_string " " in
16- let nb_sent = send_fd fd buf 0 2 [] fd_to_send in
15+ let buf = " " in
16+ let nb_sent = send_fd_substring fd buf 0 2 [] fd_to_send in
1717 Printf. printf " [sender] sent %d bytes, sent fd = %d\n %!" nb_sent (int_of_fd fd_to_send)
1818
1919let main () =
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ let t_receivefd fd =
77 let nb_read, remote_saddr, fd_recv = recv_fd fd buf 0 2 [] in
88 Printf. printf " [receiver] Received %d bytes, received fd = %d\n %!" nb_read (int_of_fd fd_recv);
99 let message = " [receiver] I'm the receiver, and I'm writing into the fd you passed to me :p\n " in
10- let nb_written = write fd_recv ( Bytes. unsafe_of_string message) 0 (String. length message) in
10+ let nb_written = write_substring fd_recv message 0 (String. length message) in
1111 assert (nb_written = String. length message)
1212
1313let t_sendfd fd =
1414 let fd_to_send = stdout in
15- let buf = Bytes. of_string " " in
16- let nb_sent = send_fd fd buf 0 2 [] fd_to_send in
15+ let buf = " " in
16+ let nb_sent = send_fd_substring fd buf 0 2 [] fd_to_send in
1717 Printf. printf " [sender] sent %d bytes, sent fd = %d\n %!" nb_sent (int_of_fd fd_to_send)
1818
1919let main () =
You can’t perform that action at this time.
0 commit comments