History log of /libuv/src/unix/tcp.c (Results 51 – 75 of 91)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 8f15aae5 19-Mar-2013 Fedor Indutny

tcp: uv_tcp_dualstack()

Explicitly disable/enable dualstack depending on presence of flag set by
uv_tcp_dualstack() function.

# 359d6678 01-Oct-2013 Ben Noordhuis

unix: sanity-check fds before closing

Ensure that close() system calls don't close stdio file descriptors
because that is almost never the intention.

This is also a partial work

unix: sanity-check fds before closing

Ensure that close() system calls don't close stdio file descriptors
because that is almost never the intention.

This is also a partial workaround for a kernel bug that seems to affect
all Linux kernels when stdin is a pipe that gets closed: fd 0 keeps
signalling EPOLLHUP but a subsequent call to epoll_ctl(EPOLL_CTL_DEL)
fails with EBADF. See joyent/node#6271 for details and a test case.

show more ...

# 255671da 31-Aug-2013 Ben Noordhuis

include: uv_tcp_connect{6} now takes sockaddr_in*

Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a

include: uv_tcp_connect{6} now takes sockaddr_in*

Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.

Fixes #684.

show more ...

# daa229ac 31-Aug-2013 Ben Noordhuis

include: uv_tcp_bind{6} now takes sockaddr_in*

Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a

include: uv_tcp_bind{6} now takes sockaddr_in*

Passing or returning structs as values makes life hard for people that
work with libuv through a foreign function interface. Switch to a
pointer-based approach.

Fixes #684.

show more ...

# 3ee4d3f1 06-Jun-2013 Ben Noordhuis

unix, windows: return error codes directly

This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like

unix, windows: return error codes directly

This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like this one:

if (uv_foo(loop) < 0) {
uv_err_t err = uv_last_error(loop);
fprintf(stderr, "%s\n", uv_strerror(err));
}

Should be rewritten like this:

int err = uv_foo(loop);
if (err < 0)
fprintf(stderr, "%s\n", uv_strerror(err));

The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.

show more ...

# 5879c613 12-May-2013 Ben Noordhuis

unix: remove errno preserving code

Remove the errno preserving code. Libuv only implemented it in a
haphazard way and there seems to be a general consensus that no one
really cares a

unix: remove errno preserving code

Remove the errno preserving code. Libuv only implemented it in a
haphazard way and there seems to be a general consensus that no one
really cares anyway. Therefore, remove it.

show more ...

# 0635e297 26-Mar-2013 Ben Noordhuis

unix, windows: remove ngx-queue.h

Avoids an extra #include in public headers and stops the ngx_queue_*
types and macros from leaking into user code.

# 905d56c1 12-Mar-2013 Ben Noordhuis

unix: fix uv_tcp_simultaneous_accepts() logic

Inverts the meaning of the 'enable' argument. Before, it actually set
the UV_TCP_SINGLE_ACCEPT flag when enable=1. Now it clears it, which i

unix: fix uv_tcp_simultaneous_accepts() logic

Inverts the meaning of the 'enable' argument. Before, it actually set
the UV_TCP_SINGLE_ACCEPT flag when enable=1. Now it clears it, which is
what uv-win does and what you would expect it to do.

show more ...

Revision tags: node-v0.8.19, node-v0.9.10, node-v0.9.7, node-v0.9.6, node-v0.9.4
# dc559a5c 18-Dec-2012 Ben Noordhuis

unix: disable relaxed accept() by default

Don't use the relaxed accept() algorithm introduced in be2a217 unless
explicitly requested. It causes a 50+% performance drop on some node.js

unix: disable relaxed accept() by default

Don't use the relaxed accept() algorithm introduced in be2a217 unless
explicitly requested. It causes a 50+% performance drop on some node.js
benchmarks:

$ alias bench='out/Release/node benchmark/http_simple_auto.js \
-c 10 -n 50000 bytes/1 2>&1 | grep Req'

$ UV_TCP_SINGLE_ACCEPT=0 bench
Requests per second: 12331.84 [#/sec] (mean)

$ UV_TCP_SINGLE_ACCEPT=1 bench
Requests per second: 3944.63 [#/sec] (mean)

show more ...

Revision tags: node-v0.8.17, node-v0.8.15, node-v0.9.3, node-v0.8.12, node-v0.8.10, node-v0.9.2, node-v0.8.9, node-v0.9.1, node-v0.8.8
# 731adaca 16-Aug-2012 Fedor Indutny

unix: use select() for specific fds on OS X

kqueue(2) on osx doesn't work (emits EINVAL error) with specific fds
(i.e. /dev/tty, /dev/null, etc). When given such descriptors - start

unix: use select() for specific fds on OS X

kqueue(2) on osx doesn't work (emits EINVAL error) with specific fds
(i.e. /dev/tty, /dev/null, etc). When given such descriptors - start
select(2) watcher thread that will emit io events.

show more ...

# a385ae4f 09-Dec-2012 Ben Noordhuis

unix: only set SO_REUSEADDR on tcp listen sockets

Avoid the extra syscall, it's a no-op for non-listening sockets.

At least, it should be - it remains to be investigated if a FreeBS

unix: only set SO_REUSEADDR on tcp listen sockets

Avoid the extra syscall, it's a no-op for non-listening sockets.

At least, it should be - it remains to be investigated if a FreeBSD kernel bug
affects ephemeral port allocation inside connect(). See [1] for details.

[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=174087

show more ...

# 65bb6f06 15-Nov-2012 Ben Noordhuis

unix: rename UV__IO_* constants

# 1282d648 22-Aug-2012 Ben Noordhuis

unix: remove dependency on libev

# be2a2176 17-Sep-2012 Ben Noordhuis

unix: rethink relaxed accept() approach

Benchmarks demonstrated that the idle timer handle approach didn't balance the
load quite fair enough, the majority of new connections still ended

unix: rethink relaxed accept() approach

Benchmarks demonstrated that the idle timer handle approach didn't balance the
load quite fair enough, the majority of new connections still ended up in one
or two processes.

The new approach voluntarily gives up a scheduler timeslice by calling
nanosleep() with a one nanosecond timeout.

Why not sched_yield()? Because on Linux (and this is probably true for other
Unices as well), sched_yield() only yields if there are other processes running
on the same CPU.

nanosleep() on the other hand always forces the process to sleep, which gives
other processes a chance to accept our pending connections.

show more ...

# cc1c1912 17-Sep-2012 Saúl Ibarra Corretgé

unix, windows: add uv_tcp_open and uv_udp_open

# 27b11abc 08-Sep-2012 Bert Belder

unix: mark accept idle handle as internal

# 3bbe8f97 03-Sep-2012 Ben Noordhuis

Merge branch 'v0.8'


# b101a53e 03-Sep-2012 Ben Noordhuis

sunos: don't set TCP_KEEPALIVE

The system headers advertise the socket option but the actual syscall fails
with ENOPROTOOPT.

Fixes joyent/node#3937.

Revision tags: node-v0.8.7
# 837edf4c 09-Aug-2012 Ben Noordhuis

unix, windows: remove handle init counters

Remove the handle init counters, no one uses them.

Revision tags: node-v0.8.6, node-v0.8.5, node-v0.6.21
# 9f7cdb20 29-Jul-2012 Ben Noordhuis

unix: add relaxed accept() setting

Mitigates unfair scheduling in multi-process setups that share a single listen
socket across multiple processes.

Revision tags: node-v0.8.3, node-v0.9.0, node-v0.8.2
# cc1b3de2 01-Jul-2012 Ben Noordhuis

unix: revert 0971598, obsoleted by 889ab21

# 0971598d 29-Jun-2012 Ben Noordhuis

unix: fix EINPROGRESS busy loop

Don't make the event loop spin when connect() returns EINPROGRESS.

Test case:

#include "uv.h"

static void connect_cb(uv_connect

unix: fix EINPROGRESS busy loop

Don't make the event loop spin when connect() returns EINPROGRESS.

Test case:

#include "uv.h"

static void connect_cb(uv_connect_t* req, int status) {
// ...
}

int main() {
uv_tcp_t handle;
uv_connect_t req;
struct sockaddr_in addr;
addr = uv_ip4_addr("8.8.8.8", 1234); // unreachable
uv_tcp_init(uv_default_loop(), &handle);
uv_tcp_connect(&req, (uv_stream_t*)&handle, addr, connect_cb);
uv_run(uv_default_loop()); // busy loops until connection times out
return 0;
}

After EINPROGRESS, there are zero active handles and one active request. That
in turn makes uv__poll_timeout() believe that it should merely poll, not block,
in epoll() / kqueue() / port_getn().

Sidestep that by artificially starting the handle on connect() and stopping it
again once the TCP handshake completes / is rejected / times out.

It's a slightly hacky approach because I don't want to change the ABI of the
stable branch. I'll address it properly in the master branch.

show more ...

# 1a6b6b78 29-Jun-2012 Ben Noordhuis

unix: deduplicate socket creation code in tcp.c

Incidentally fixes a rather obscure bug where uv_tcp_connect() reconnected
and leaked a file descriptor when the handle was already busy c

unix: deduplicate socket creation code in tcp.c

Incidentally fixes a rather obscure bug where uv_tcp_connect() reconnected
and leaked a file descriptor when the handle was already busy connecting,
handle->fd was zero (unlikely) and uv_tcp_connect() got called again.

show more ...

# e4a68bb5 29-Jun-2012 Ben Noordhuis

unix: move uv__connect() to tcp.c

Revision tags: node-v0.8.1, node-v0.8.0, node-v0.7.12, node-v0.7.11, node-v0.7.10, node-v0.6.19, node-v0.7.9
# 3bc97070 23-May-2012 Ben Noordhuis

unix: replace ev_io with uv__io_t

Replace ev_io usage with wrapper constructs.

This is preliminary work for the transition to a libev-less linux backend.

1234