File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,8 +39,13 @@ let rec recv_from_switch_fd (sock : file_descr) : (xid * msg) option Lwt.t =
3939let send_to_switch_fd (sock : file_descr ) (xid : xid ) (msg : msg ) : bool Lwt.t =
4040 lwt msg_buf = Lwt. wrap2 Message. marshal xid msg in
4141 let msg_len = String. length msg_buf in
42- lwt sent = Lwt_unix. write sock msg_buf 0 msg_len in
43- Lwt. return (sent = msg_len)
42+ try_lwt
43+ lwt sent = Lwt_unix. write sock msg_buf 0 msg_len in
44+ Lwt. return (sent = msg_len)
45+ with Unix. Unix_error (err , fn , arg ) ->
46+ Printf. printf " [platform0x01] error sending: %s (in %s)\n %!"
47+ (Unix. error_message err) fn;
48+ Lwt. return (false )
4449
4550let switch_handshake_finish (fd : file_descr ) : OF.SwitchFeatures.t option Lwt.t =
4651 match_lwt send_to_switch_fd fd 0l Message. SwitchFeaturesRequest with
You can’t perform that action at this time.
0 commit comments