Commit Graph

248 Commits (415bff26fe5744001f185001fc49f9369ab76227)

Author SHA1 Message Date
Dmitry Nizovtsev 1e9bcf26ce net, http, https: add localAddress option
Binds to a local address before making the outgoing connection.
2012-03-06 13:35:49 +01:00
koichik cd5d2473a4 net: fix race write() before and after connect()
Fixes #2827.
2012-02-28 19:57:13 +09:00
Mikeal Rogers d530ee62cd Issue #2762. Add callback to close function. 2012-02-18 17:46:28 -08:00
isaacs 0cdf85e28d Lint all the JavaScripts. 2012-02-18 15:34:57 -08: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