Skip to content

Commit 0811c8c

Browse files
committed
Expose socket timeouts
1 parent 57f67e2 commit 0811c8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sys/socket/sockopt.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use {NixResult, NixError, from_ffi};
22
use super::{ffi, consts, SockOpt};
33
use errno::Errno;
4+
use sys::time::TimeVal;
45
use libc::{c_int, uint8_t, c_void, socklen_t};
56
use std::mem;
67
use std::os::unix::Fd;
@@ -74,6 +75,8 @@ sockopt_impl!(Linger, consts::SO_LINGER, super::linger);
7475
sockopt_impl!(IpAddMembership, consts::IP_ADD_MEMBERSHIP, super::ip_mreq);
7576
sockopt_impl!(IpDropMembership, consts::IP_DROP_MEMBERSHIP, super::ip_mreq);
7677
sockopt_impl!(IpMulticastTtl, consts::IP_MULTICAST_TTL, u8);
78+
sockopt_impl!(ReceiveTimeout, consts::SO_RCVTIMEO, TimeVal);
79+
sockopt_impl!(SendTimeout, consts::SO_SNDTIMEO, TimeVal);
7780

7881
/*
7982
*

0 commit comments

Comments
 (0)