Compare commits
1 Commits
v1.x
...
tcp-keepal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14403a8f63 |
@ -467,9 +467,6 @@ int uv__tcp_keepalive(int fd, int on, unsigned int delay) {
|
||||
if (!on)
|
||||
return 0;
|
||||
|
||||
if (delay == 0)
|
||||
return -1;
|
||||
|
||||
#ifdef __sun
|
||||
/* The implementation of TCP keep-alive on Solaris/SmartOS is a bit unusual
|
||||
* compared to other Unix-like systems.
|
||||
|
||||
@ -33,7 +33,7 @@ TEST_IMPL(tcp_flags) {
|
||||
|
||||
loop = uv_default_loop();
|
||||
|
||||
r = uv_tcp_init(loop, &handle);
|
||||
r = uv_tcp_init_ex(loop, &handle, AF_INET);
|
||||
ASSERT_OK(r);
|
||||
|
||||
r = uv_tcp_nodelay(&handle, 1);
|
||||
@ -42,6 +42,12 @@ TEST_IMPL(tcp_flags) {
|
||||
r = uv_tcp_keepalive(&handle, 1, 60);
|
||||
ASSERT_OK(r);
|
||||
|
||||
r = uv_tcp_keepalive(&handle, 0, 0);
|
||||
ASSERT_OK(r);
|
||||
|
||||
r = uv_tcp_keepalive(&handle, 1, 0);
|
||||
ASSERT_OK(r);
|
||||
|
||||
uv_close((uv_handle_t*)&handle, NULL);
|
||||
|
||||
r = uv_run(loop, UV_RUN_DEFAULT);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user