Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Eio_unix.Sockopt for setting/getting socket options #575

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more windows
avsm committed Jul 23, 2023
commit 287940d38d81dbbb478e883f5d0c2a15972bb726
6 changes: 6 additions & 0 deletions lib_eio_windows/net.ml
Original file line number Diff line number Diff line change
@@ -57,6 +57,12 @@ let datagram_socket sock = object
let recv, addr = Err.run (Low_level.recv_msg sock) b in
Cstruct.blit_from_bytes b 0 buf 0 recv;
Eio_unix.Net.sockaddr_of_unix_datagram addr, recv

method getsockopt : type a. a Eio.Net.Sockopt.t -> a = fun opt ->
Eio_unix.Net.Sockopt.get fd opt

method setsockopt : type a. a Eio.Net.Sockopt.t -> a -> unit = fun opt v ->
Eio_unix.Net.Sockopt.set fd opt v
end

(* https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml *)