32 struct sockaddr_storage saddr;
51 memset(&saddr, 0,
sizeof(saddr));
68 struct sockaddr_storage saddr;
88 memset(&saddr, 0,
sizeof(saddr));
151 unsigned int flags) {
171 if (setsockopt(tcp->io_watcher.fd,
194 tcp->delayed_error =
UV__ERR(errno);
223 handle->delayed_error = 0;
228 }
while (
r == -1 && errno ==
EINTR);
235 if (
r == -1 && errno != 0) {
239 #
if defined(__OpenBSD__)
260 if (
handle->delayed_error)
287 if (
handle->delayed_error)
288 return handle->delayed_error;
301 if (
handle->delayed_error)
302 return handle->delayed_error;
313 struct linger l = { 1, 0 };
329 static int single_accept_cached = -1;
334 if (tcp->delayed_error)
335 return tcp->delayed_error;
338 if (single_accept == -1) {
339 const char*
val =
getenv(
"UV_TCP_SINGLE_ACCEPT");
340 single_accept = (
val !=
NULL && atoi(
val) != 0);
359 if (
listen(tcp->io_watcher.fd, backlog))
362 tcp->connection_cb =
cb;
374 if (setsockopt(
fd, IPPROTO_TCP, TCP_NODELAY, &on,
sizeof(on)))
388 if (setsockopt(
fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay,
sizeof(delay)))
390 if (setsockopt(
fd, IPPROTO_TCP, TCP_KEEPINTVL, &intvl,
sizeof(intvl)))
392 if (setsockopt(
fd, IPPROTO_TCP, TCP_KEEPCNT, &cnt,
sizeof(cnt)))
401 #if defined(TCP_KEEPALIVE) && !defined(__sun)
402 if (on && setsockopt(
fd, IPPROTO_TCP,
TCP_KEEPALIVE, &delay,
sizeof(delay)))
static mcore_handle handle
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd domain
return memset(p, 0, total)
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset void static length char static len const struct iovec static count unsigned long static filedes static sched_yield static flags static oldfd static pause unsigned static seconds static protocol struct sockaddr addrlen
assert(limit<=UINT32_MAX/2)
static struct sockaddr static addrlen listen
static struct sockaddr static addrlen static backlog const void static flags void flags
void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events)
int uv__fd_exists(uv_loop_t *loop, int fd)
int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, struct sockaddr *name, int *namelen)
int uv__socket(int domain, int type, int protocol)
void uv__io_feed(uv_loop_t *loop, uv__io_t *w)
int uv__stream_open(uv_stream_t *, int fd, int flags)
void uv__server_io(uv_loop_t *loop, uv__io_t *w, unsigned int events)
#define uv__stream_fd(handle)
void uv__stream_close(uv_stream_t *handle)
void uv__stream_init(uv_loop_t *loop, uv_stream_t *stream, uv_handle_type type)
static int maybe_new_socket(uv_tcp_t *handle, int domain, unsigned long flags)
int uv__tcp_keepalive(int fd, int on, unsigned int delay)
int uv__tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, unsigned int addrlen, uv_connect_cb cb)
int uv__tcp_bind(uv_tcp_t *tcp, const struct sockaddr *addr, unsigned int addrlen, unsigned int flags)
int uv_tcp_init(uv_loop_t *loop, uv_tcp_t *tcp)
int uv_tcp_close_reset(uv_tcp_t *handle, uv_close_cb close_cb)
static int new_socket(uv_tcp_t *handle, int domain, unsigned long flags)
int uv_tcp_listen(uv_tcp_t *tcp, int backlog, uv_connection_cb cb)
int uv_tcp_nodelay(uv_tcp_t *handle, int on)
int uv_tcp_open(uv_tcp_t *handle, uv_os_sock_t sock)
int uv_tcp_getpeername(const uv_tcp_t *handle, struct sockaddr *name, int *namelen)
int uv_tcp_simultaneous_accepts(uv_tcp_t *handle, int enable)
int uv_tcp_init_ex(uv_loop_t *loop, uv_tcp_t *tcp, unsigned int flags)
int uv_tcp_keepalive(uv_tcp_t *handle, int on, unsigned int delay)
void uv__tcp_close(uv_tcp_t *handle)
int uv__tcp_nodelay(int fd, int on)
int uv_tcp_getsockname(const uv_tcp_t *handle, struct sockaddr *name, int *namelen)
@ UV_HANDLE_TCP_KEEPALIVE
@ UV_HANDLE_TCP_SINGLE_ACCEPT
#define uv__load_relaxed(p)
#define uv__store_relaxed(p, v)
#define uv__req_init(loop, req, typ)
void(* uv_connection_cb)(uv_stream_t *server, int status)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
void(* uv_connect_cb)(uv_connect_t *req, int status)
void(* uv_close_cb)(uv_handle_t *handle)
static const z80_opcode fd[]