2 #include <sys/socket.h>
10 void set_udp_cork(int fd
)
14 ret
= setsockopt(fd
, IPPROTO_UDP
, UDP_CORK
, &state
, sizeof(state
));
16 panic("Cannot cork UDP socket!\n");
19 void set_udp_uncork(int fd
)
23 ret
= setsockopt(fd
, IPPROTO_UDP
, UDP_CORK
, &state
, sizeof(state
));
25 panic("Cannot uncork UDP socket!\n");
28 void set_tcp_cork(int fd
)
32 ret
= setsockopt(fd
, IPPROTO_TCP
, TCP_CORK
, &state
, sizeof(state
));
34 panic("Cannot cork TCP socket!\n");
37 void set_tcp_uncork(int fd
)
41 ret
= setsockopt(fd
, IPPROTO_TCP
, TCP_CORK
, &state
, sizeof(state
));
43 panic("Cannot uncork TCP socket!\n");
46 void set_sock_cork(int fd
, bool is_udp
)
54 void set_sock_uncork(int fd
, bool is_udp
)