isaacs
a2851b6234
Revert "cluster: propagate bind errors"
...
This reverts commit 30e462e919
.
2012-02-17 12:39:45 -08:00
Ben Noordhuis
30e462e919
cluster: propagate bind errors
...
This commit fixes a bug where the cluster module failed to propagate EADDRINUSE
errors.
When a worker starts a (net, http) server, it requests the listen socket from
its master who then creates and binds the socket.
Now, OS X and Windows don't always signal EADDRINUSE from bind() but instead
defer the error until a later syscall. libuv mimics this behaviour to provide
consistent behaviour across platforms but that means the worker could end up
with a socket that is not actually bound to the requested addresss.
That's why the worker now checks if the socket is bound, raising EADDRINUSE if
that's not the case.
Fixes #2721 .
2012-02-16 23:47:17 +01:00
Ben Noordhuis
8a6576f764
Merge remote-tracking branch 'origin/v0.6'
...
Conflicts:
common.gypi
2012-02-12 16:12:26 +01:00
Igor Zinkovsky
c7771bc2ec
set readable/writable for pipes
2012-02-10 11:28:43 -08:00
isaacs
116835561d
Merge remote-tracking branch 'ry/v0.6'
...
Conflicts:
ChangeLog
deps/v8/src/version.cc
deps/v8/tools/gyp/v8.gyp
doc/about/index.html
doc/community/index.html
doc/index.html
doc/logos/index.html
doc/template.html
lib/path.js
lib/querystring.js
src/node_version.h
2012-02-06 15:43:21 -08:00
koichik
0f0af55a0a
net: fix large file downloads failing
...
Fixes #2678 .
2012-02-05 17:41:49 +09:00
Stefan Rusu
4671e54495
net: destroy socket on DNS error
...
The socket was never destroyed on DNS errors. This broke some clients, including
lib/https.js.
2012-02-04 00:40:53 +01:00
Igor Zinkovsky
db3c4efd1d
support for sharing streams accross isolates
2012-01-31 17:45:50 -08:00
Ben Noordhuis
e806ad39d0
net, tls, http: remove socket.ondrain
...
Replace the ondrain hack with a regular 'drain' listener. Speeds up the
bytes/1024 http benchmark by about 1.2%.
2012-01-24 15:57:50 +01:00
Ryan Dahl
ca2a047b8e
Merge remote branch 'origin/v0.6'
...
Conflicts:
deps/uv/src/win/util.c
src/udp_wrap.cc
2012-01-16 15:20:26 -08:00
Ben Noordhuis
f0c1376e07
net: make .write() throw on bad input
...
Passing a non-buffer or non-string argument to Socket.prototype.write triggered
an assert:
Assertion failed: (Buffer::HasInstance(args[0])), function Write,
file ../src/stream_wrap.cc, line 289.
Fixes #2532 .
2012-01-14 02:13:24 +01:00
koichik
70033bd960
net: make connect() accept options
...
This makes API even with tls.connect().
Refs #1983 .
See also:
http://groups.google.com/group/nodejs-dev/msg/3b6dbcc4a9a82d99
Fixes #2487 .
2012-01-09 02:18:39 +01:00
Andreas Madsen
5f08c3cfa1
cluster improvements: Worker class and isolate internal messages
...
Fixes #2388
2012-01-04 18:30:19 -08:00
Ben Noordhuis
c24276f008
net: defer net.Server 'close' event to next tick
2011-12-29 19:30:07 +01:00
koichik
a848a3efbf
net: fix Socket.pause null reference when called on a closed Stream
...
Fixes #1980 .
2011-12-28 15:13:57 +09:00
Ju-yeong Park
5976d58796
net: raise exception when the socket is closed
2011-12-22 17:25:14 +01:00
James Hartig
348d8cd04a
timers: remove _idleTimeout from item in .unenroll()
...
Stops .active() from reactivating the timer.
Fixes #2114 .
2011-12-20 00:57:15 +01:00
Ben Noordhuis
8295c80618
net: check status code in afterWrite
...
Fixes memory leak and spin on writing to dead fds. This was tested in
production.
2011-12-12 13:45:44 -08:00
isaacs
580e67015c
Apply #2257 fix for Pipe streams as well as TTYs
2011-12-06 10:13:31 -08:00
isaacs
cf20b6bf65
Fix #2257 pause/resume semantics for stdin
...
This makes it so that the stdin TTY-wrap stream gets ref'ed on
.resume() and unref'ed on .pause()
The semantics of the names "pause" and "resume" are a bit weird, but the
important thing is that this corrects an API change from 0.4 -> 0.6
which made it impossible to read from stdin multiple times, without
knowing when it might end up being closed. If no one has it open, this
lets the process die naturally.
LGTM'd by @ry
2011-12-05 16:47:11 -08:00
isaacs
db273818f6
s/NPM/npm/
...
http://npmjs.org/doc/faq.html#If-npm-is-an-acronym-why-is-it-never-capitalized
2011-12-05 16:20:44 -08:00
Igor Zinkovsky
99c9d19184
binding for uv_pipe_pending_instances
2011-12-01 13:57:47 -08:00
Ben Noordhuis
03eb41c2ec
net: don't emit 'close' event twice
...
Don't allow `socket.destroy()` to run twice. The self-destruct sequence itself
is idempotent but it makes the 'close' and 'error' events fire more than once,
which may confuse listeners.
Fixes #2223 .
2011-12-01 14:57:06 +01:00
Ryan Dahl
86528489ec
new cluster api
2011-11-04 15:12:11 -07:00
Ryan Dahl
4a8088a603
Socket.write should reset timeout timer.
...
Fixes #2002 .
2011-11-03 12:37:04 -07:00
Ben Noordhuis
9c11e8a1ca
net: implement Server.prototype.address() for pipes
2011-11-03 19:16:10 +01:00
Ryan Dahl
60818b957c
Add missing copyright headers
2011-11-02 10:00:57 -07:00
Maciej Małecki
7ee29d1d5b
net: Server.listen
, Server.close
and Socket.connect
return this
...
Just a syntactic sugar for doing, for example:
var server = net.createServer(function (c) {
c.end('goodbye, cruel world!\r\n');
server.close().on('close', function () {
console.log('really, goodbye!');
});
}).listen(1337);
Fixes #1922 .
2011-10-24 22:19:42 +09:00
Ben Noordhuis
ac379b3be1
net: bring back .setNoDelay() and .setKeepAlive()
2011-10-21 18:09:23 -07:00
Ryan Dahl
6cc0c9e6a9
Remove superfluous nextTick during server binding
...
This breaks fork().send({}, server._handle) after server.listen() because
server._handle is not set.
2011-10-18 15:12:18 -07:00
koichik
d6191f593d
net: fix error handling in listen()
...
Fixes #1894 .
2011-10-16 01:30:19 +09:00
Ben Noordhuis
0b92fa0e93
net: fix connect queue bugs
...
This commit fixes two bugs in the handling of write requests when the connect()
call is still in progress.
1. The deferred write request's size was counted twice towards `.bytesWritten`.
2. The callback was not called. After connecting, `Socket.write()` was called
with three arguments (data, encoding, cb) but it ignored the third argument.
Coincidentally fixes test/simple/test-net-connect-buffer.js.
2011-10-15 03:34:09 +02:00
Ben Noordhuis
6df574b744
net: properly account multi-byte chars in .bytesWritten
2011-10-15 03:24:34 +02:00
Simen Brekken
4b0e36810a
net: register net.Server callback only once
...
Only register once for listening when passing a callback to Server.listen(),
this prevents servers recycled using close() from invoking the callback when
Server.listen() is called later.
2011-10-13 16:09:14 +02:00
Ryan Dahl
25ff181300
Revert some changes made in 12486a6
...
Some of the perf improvements from many-writes-fix branch were accidentally
undone in that commit. This puts them back in.
2011-10-12 12:49:58 -07:00
Ryan Dahl
87339a22b1
introduce node cluster
2011-10-12 02:58:35 -07:00
Ryan Dahl
be0bb2dc13
Remove net_legacy timers_legacy
2011-10-11 13:11:54 -07:00
Ryan Dahl
710f8e2acc
Add --use-uv command-line flag to use libuv backend
2011-06-17 13:51:40 +02:00
Felix Geisendörfer
f0a440d886
Remove 'connect' event from server side sockets
...
Sockets emitted by the 'connection' event are always connected, having
them emit the 'connect' event makes no sense. It only confused people,
as it's not clear if you have to listen to 'connect' or not.
That try..catch block was also very scary. It would silently swallow
exceptions in 'connect' listeners and destroy the socket. Makes no
sense.
Fixes #1047 .
2011-05-24 11:22:59 -07:00
Ryan Dahl
9e6498d5fa
Merge branch 'v0.4'
...
Conflicts:
src/node_version.h
2011-04-18 18:58:16 -07:00
Ryan Dahl
8417870f51
Don't emit error on ECONNRESET - just close
...
Fix #670
2011-04-14 10:42:57 -07:00
Ryan Dahl
598792ba91
Merge branch 'v0.4'
...
Conflicts:
src/platform_sunos.cc
test/simple/test-os.js
2011-04-14 01:11:21 +00:00
Brian White
ac1da4b407
Add remoteAddress and remotePort for client TCP connections
...
https://groups.google.com/d/topic/nodejs-dev/Asr87_YFSkg/discussion
2011-04-13 10:24:28 -07:00
Ryan Dahl
9ccf0e527f
Don't error on ENOTCONN from shutdown()
2011-04-11 15:33:24 -07:00
Ryan Dahl
7a8c729830
Merge branch 'v0.4'
...
Conflicts:
src/node_version.h
2011-03-22 13:12:07 -07:00
Ryan Dahl
d7a86ff05e
Fix GH-819. Drop out if connection destroyed before connect()
2011-03-21 14:48:26 -07:00
Daniel Ennis
911cbd0cef
Add support for file descriptor type detection.
...
setImplementationMethods checks the type of a socket and defines different
behavior based on the type, so auto detect it if type not implicitly
specified.
2011-03-17 10:35:47 -07:00
Ryan Dahl
55048cdf79
Update copyright headers
2011-03-14 17:37:05 -07:00
koichik
414fa4abae
Better type checks for fd in net.js
2011-03-11 16:34:12 -08:00
koichik
113b1e6e0c
Fix GH-746 process.stdin.destroy() breaks http server
2011-03-11 16:33:07 -08:00
Andreas Reich
5e91042fcb
Don't decrease server connection counter again if destroy() is called more than once
...
Test: Anders Conbere <aconbere@gmail.com>
Fix: Andreas Reich <andreas@reich.name>
Closes GH-431.
Closes GH-502.
2011-03-04 15:45:12 -08:00
Ryan Dahl
e9257b859d
New DTrace probes from CA team
2011-02-09 18:50:26 -08:00
Ryan Dahl
a48a075535
better debug messages in net and tls
2011-02-09 10:23:26 -08:00
Ryan Dahl
4733d0b1f0
http: handle aborts
2011-02-04 18:07:00 -08:00
Ryan Dahl
9f3a20c76d
net: Add hook for when writeQueue changes
2011-01-31 11:01:59 -08:00
Ryan Dahl
6ede26cb9c
Add socket.bufferSize
2011-01-31 10:41:52 -08:00
Ryan Dahl
bfb6a67d60
Another fix for process.assert
2011-01-27 16:59:28 -08:00
Ali Farhadi
c70dd70301
Adding callback parameter to Socket's setTimeout method.
2011-01-26 12:13:03 -08:00
Ryan Dahl
068b733583
Land Cantrill's DTrace patch
...
only works on solaris
2011-01-24 18:59:06 -08:00
Ryan Dahl
9e976abad9
lint
2011-01-24 10:55:30 -08:00
Ryan Dahl
b22b5e341b
listen/bind errors should close net.Server
2011-01-18 16:22:43 -08:00
Bert Belder
0eb4c2157d
Define winsock error numbers
2011-01-18 04:58:30 +01:00
Ryan Dahl
5f5201db2f
Fix test-net-connect-buffer
...
Change to end() behavior in 33c339 was breaking it. end() should wait for
connection before dumping. Changed test-net-connect-timeout to use destroy()
instead.
2011-01-12 13:29:45 -08:00
Ryan Dahl
5f795efd4e
net: Timeouts should work before DNS resolution
2011-01-12 12:59:58 -08:00
Ryan Dahl
33c33949b2
Add test for connection timeouts
...
Also make socket.end() destroy connection if still trying to connect.
Previously was ignoring.
2011-01-12 10:57:03 -08:00
Ryan Dahl
5a05992155
Lint
2011-01-06 16:06:27 -08:00
Ryan Dahl
b62152bc84
Rename net.Stream to net.Socket
2011-01-05 11:53:56 -08:00
Ryan Dahl
bc1d758408
net.js: Check that readWatcher exists before pause, resume
2011-01-04 11:25:36 -08:00
Ryan Dahl
2957382991
Implement new stream method, destroySoon
...
Still missing on fs.WriteStream
2011-01-04 11:22:19 -08:00
Ryan Dahl
e4dd5cd6fd
NODE_DEBUG uses strings instead of bitflags
2011-01-03 15:41:58 -08:00
Ryan Dahl
632da2a393
Add callback paramenter to socket.connect()
2010-12-15 15:57:41 -08:00
Ryan Dahl
c4161f32f5
Add callback to socket.write()
2010-12-15 15:47:02 -08:00
Ryan Dahl
c970968ee6
better option parsing for socket.write()
2010-12-15 15:15:27 -08:00
Ryan Dahl
92789b16e5
Fix global leaks
2010-12-04 16:36:21 -08:00
Ryan Dahl
e232f6e735
more lint
2010-12-01 20:28:28 -08:00
Ryan Dahl
ec1589875c
Stop watcher before calling .set() in Stream.prototype.resume
2010-12-01 12:52:34 -08:00
Ryan Dahl
a6f6532dfb
Fix test-securepair-server
2010-11-23 18:30:52 -08:00
Ryan Dahl
2320497992
Revert "Merge branch 'writev'"
...
This reverts commit cd9515efd9
, reversing
changes made to df46c8e698
.
Too slow. Needs more work.
2010-11-20 20:55:15 -08:00
Ryan Dahl
1f18648394
Fix typo
2010-11-18 16:47:38 -08:00
Ryan Dahl
2ba3c10d62
Only try to flush big buffers once
2010-11-18 16:47:38 -08:00
Ryan Dahl
849792e46b
Add todo about test-pipe.js and throwing on resume()
2010-11-18 16:47:38 -08:00
Ryan Dahl
544877d12e
Fix socket.end() problem on non-empty queue
2010-11-18 16:47:38 -08:00
Ryan Dahl
3884b4185a
Small clean ups
2010-11-18 16:47:38 -08:00
Ryan Dahl
02039c9b53
'connect' event may disconnect socket
2010-11-18 16:47:38 -08:00
Ryan Dahl
fa556a1425
Add callback to socket.write(), fix test-sendfds
2010-11-18 16:47:38 -08:00
Ryan Dahl
a6d8425382
make sure unix sockets are tagged correctly
2010-11-18 16:47:38 -08:00
Ryan Dahl
5d6a03c9fe
Don't append buckets of zero length
2010-11-18 16:47:38 -08:00
Ryan Dahl
10ff559ec3
Add IOWatcher.flush()
...
To be called if sockets get too much data. This is to force a flush before
the tick ends.
2010-11-18 16:47:37 -08:00
Ryan Dahl
7c3c5c6861
Maintain queueSize for each socket
2010-11-18 16:47:37 -08:00
Ryan Dahl
5a84461e46
Also do ondrain callback for socket (needed by http)
2010-11-18 16:47:37 -08:00
Ryan Dahl
e1250a3333
Reset _eof on socket reuse
2010-11-18 16:47:37 -08:00
Ryan Dahl
5ba0be6166
Don't send null data segments
2010-11-18 16:47:37 -08:00
Ryan Dahl
dcc547d798
Dumper net.js integration
2010-11-18 16:47:37 -08:00
Ryan Dahl
df46c8e698
Rip out the old TLS implementation
2010-11-18 16:46:37 -08:00
Ryan Dahl
cf05257fb7
Test for server.listen() more carefully, fix bug
2010-11-16 15:33:21 -08:00
Ryan Dahl
4144024e6b
Test and fix for self-assigned port from net.Server
2010-11-15 20:22:54 -08:00
Ryan Dahl
f1391f33cd
Add missing require('fs')
2010-11-01 14:56:21 -07:00
Ryan Dahl
1eb547fec1
Lazy load modules in net.js
2010-10-28 13:15:53 -07:00
Ryan Dahl
5171da5a6c
Remove a little redundancy
2010-10-28 13:11:42 -07:00
Ryan Dahl
65dced730f
Handle one more onReadable call from crypto
...
MUST get rid of this calledByIOWatcher stuff. Hopefully will be able to when
securepair stuff lands.
2010-10-28 12:34:48 -07:00