Commit Graph

35 Commits

Author SHA1 Message Date
Herbert Vojčík
4db608dbba Get away uint/int comparision warning. 2010-08-16 15:17:17 -07:00
Rasmus Andersson
8d5e05668b Added support for multiple listeners to DNS multicast datagrams.
Some platforms require SO_REUSEPORT to be set for the socket.
2010-08-11 19:02:20 -07:00
Benjamin Kramer
eeb54c63d8 Fix addrlen for unix_dgram sockets
The old definition was off by one byte on BSD. Also simplify
ADDRESS_TO_JS because sun_path is always zero-terminated now.
2010-07-26 22:13:49 +02:00
Ryan Dahl
02746eddd6 Apple's SUN_LEN is broken, override 2010-07-17 23:26:58 -07:00
Ryan Dahl
341e41726f Set SO_REUSEADDR on all sockets 2010-07-17 23:10:38 -07:00
Ryan Dahl
fa344d8514 Fix solaris build 2010-07-16 23:24:08 -07:00
Matt Ranney
98341daee2 Fix unix dgram socket address resolution on Linux. 2010-07-15 16:46:46 -07:00
Matt Ranney
4e50197e53 Datagram socket refactor. Add tests and documentation.
Support setTTL() and setBroadcast() socket options.
2010-07-15 10:27:44 -07:00
Paul Querna
30dadfc033 Register builtin extensions via a macro, rather than a manual strcmp
Set the stage for making the builtin modules more dynamic.

Note: this only converts crypto and net, I will add more extensions in a
later commit.

* node.h: Add utility macro for converting macro values to strings.

* node.h: Include the actual module name inside the module structure, not
  just the file it was built from.

* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
  to a module structure.

* node_extensions.cc: New File, implements get_builtin_module, which
  iterates over the module structures that are compiled into node.

* node.cc(node::Binding): Use the new module lookup function to find
  modules.

* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.
2010-07-14 10:17:25 -07:00
Peter Griess
6eb0b6ac27 Coverity fixes: src/node_net 2010-07-12 13:20:31 -07:00
Peter Griess
4e3c5d88b3 Coverity fixes: src/node.cc 2010-07-12 13:20:26 -07:00
Blake Mizerany
8c8534046c fix whitespace errors 2010-06-29 23:59:24 -07:00
Ryan Dahl
0a8bd34b69 Resolve .local domains with getaddrinfo()
C-Ares doesn't go through the Name Service Switch (NSS) and thus can't
resolve certain classes of names. Generally this doesn't matter and the
whole idea of NSS is rather annoying. Nevertheless until C-Ares gets better
support, adding this hack to go through getaddrinfo() for .local domain look
up.

This reverts commit 9926dacd14.
2010-06-29 22:15:28 -07:00
David Siegel
81ad8106dc Add UDP broadcast support 2010-06-16 10:45:16 -07:00
Paul Querna
02da5ed4a1 Implement datagram sockets
- Adds new dgram module, for all data-gram type transports
- Supports both UDP client and servers
- Supports Unix Daemon sockets in DGRAM mode too (think syslog)
- Uses a shared Buffer and slices that as needed to be reasonably
  performant.
- One supplied test program so far, test-dgram-pingpong
- Passes test cases on osx 10.6 and ubuntu 9.10u
2010-06-12 02:41:45 -07:00
Peter Griess
8f0b4e9111 Send and receive file descriptors through net.Stream.
a) create a layer of indirection in net.Stream to allow swapping in
different read/write implementations and

b) emit an 'fd' event when file descriptors are received over a UNIX pipe,
as finally as a tangential benefit

c) remove a bunch of conditionals from the primary codepaths for
ease-of-reading.
2010-06-02 18:16:53 -07:00
Ryan Dahl
78e49f1c88 Rename node_net2.cc to node_net.cc 2010-05-29 13:08:05 -07:00
Ryan Dahl
c72967d335 Remove http_old tcp_old 2010-04-23 17:19:29 -07:00
Krishna Rajendran
0d5a1fed33 Use gai_strerror when tcp.Server fails to resolve its address or service. 2010-03-14 23:08:45 -07:00
Ryan Dahl
0e844d3bcb tcp.Connection.prototype.write should return boolean 2010-03-02 21:16:17 -08:00
Ryan Dahl
62c4214711 Properly throw error on failed connection 2010-03-02 20:59:47 +00:00
Ryan Dahl
c094dda53c Move errors for readPause and readResume 2010-02-21 16:01:12 -08:00
Ryan Dahl
a0c48eecab Rename readPause and readResume to pause/resume 2010-02-20 22:38:42 -08:00
Ryan Dahl
ecd61742a1 Throw from connection.connect if resolving.
Bug reported by James Golick.
2010-02-16 14:38:51 -08:00
Ryan Dahl
23cf502db7 API: connection.send() renamed to connection.write() 2010-02-16 13:18:42 -08:00
Zoka
fbef11b679 Use InstanceTemplate() instead of PrototypeTemplate() for accessor methods
This fixes crash that used to happen when Eclipse debugging session hits the
breakpoint that is set either in timer or connection callback.
2010-02-16 09:04:19 -08:00
Ryan Dahl
bc17d94a0a API: tcp events 'receive' to 'data', 'eof' to 'end'
No deprecation messages. Not sure how...
2010-02-12 00:25:19 -08:00
Ryan Dahl
77145ba229 Throw errors from server.listen() 2010-02-07 16:51:20 -08:00
Ryan Dahl
45a806a066 Statically define symbols
~7% improvement in hello world HTTP response bench.
2009-12-09 09:12:01 +01:00
Ryan Dahl
c1baa70fe5 Attach/Detach -> Ref/Unref 2009-12-07 17:55:19 +01:00
Rhys Jones
5b1a535cd8 Add HTTP client TLS support 2009-11-30 16:51:20 +01:00
Rhys Jones
b6dda61249 Initial TLS support 2009-11-22 04:03:53 +01:00
Johan Sørensen
04f9c9fb09 Supply the strerror as a second arg to the tcp.Connection close event 2009-11-13 15:17:23 +01:00
Ryan Dahl
2ca788e6e2 Add 'drain' event to tcp.Connection 2009-11-10 17:43:37 +01:00
Ryan Dahl
a5df0f6a65 Prefix all source files with node_ 2009-10-27 11:46:58 +01:00