summaryrefslogtreecommitdiff
path: root/src/pipe_wrap.h
Commit message (Collapse)AuthorAgeFilesLines
* src: pull AfterConnect from pipe_wrap and tcp_wrapDaniel Bevenius2016-09-131-2/+0
| | | | | | | | | | | | | | | | This commit attempts to address one of the items in https://github.com/nodejs/node/issues/4641 which is related to src/pipe_wrap.cc and src/tcp_wrap.cc. Currently both pipe_wrap.cc and tcp_wrap.cc contain an AfterConnect function that are almost identical. This commit extracts this function into ConnectionWrap so that that both can share it. PR-URL: https://github.com/nodejs/node/pull/8448 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* src: pull OnConnection from pipe_wrap and tcp_wrapDaniel Bevenius2016-08-101-7/+2
| | | | | | | | | | | | One of the issues in #4641 concerns OnConnection in pipe_wrap and tcp_wrap which are very similar with some minor difference in how they are coded. This commit extracts OnConnection so both these classes can share the same implementation. PR-URL: https://github.com/nodejs/node/pull/7547 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* src: add include guards to internal headersBen Noordhuis2016-06-021-0/+3
| | | | | | | | | | | For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: https://github.com/nodejs/node/pull/6948 Refs: https://github.com/nodejs/node/pull/6910 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* src: replace usage of v8::Handle with v8::LocalMichaƫl Zasso2015-09-061-4/+4
| | | | | | | v8::Handle is deprecated: https://codereview.chromium.org/1224623004 PR-URL: https://github.com/nodejs/io.js/pull/2202 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* Revert "lib,src: add unix socket getsockname/getpeername"Ben Noordhuis2015-08-281-3/+0
| | | | | | | | | | | | This reverts commit 6cd0e2664b1ce944e5e461457d160be83f70d379. This reverts commit 7a999a13766ac68049812fedbdfd15a0250f0f07. This reverts commit f337595441641ad36f6ab8ae770e56c1673ef692. It turns out that on Windows, uv_pipe_getsockname() is a no-op for client sockets. It slipped through testing because of a CI snafu. PR-URL: https://github.com/nodejs/node/pull/2584 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* lib,src: add unix socket getsockname/getpeernameBen Noordhuis2015-08-271-0/+3
| | | | | | | | | | | | | | | | | The implementation is a minor API change in that socket.address() now returns a `{ address: '/path/to/socket' }` object, like it does for TCP and UDP sockets. Before this commit, it returned `socket._pipeName`, which is a string when present. Change common.PIPE on Windows from '\\\\.\\pipe\\libuv-test' to '\\\\?\\pipe\\libuv-test'. Windows converts the '.' to a '?' when creating a named pipe, meaning that common.PIPE didn't match the result from NtQueryInformationFile(). Fixes: https://github.com/nodejs/node/issues/954 PR-URL: https://github.com/nodejs/node/pull/956 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* async-wrap: add provider id and object info cbTrevor Norris2015-06-171-0/+2
| | | | | | | | | | | | | | | | | | | Re-add the wrapper class id to AsyncWrap instances so they can be tracked directly in a heapdump. Previously the class id was given without setting the heap dump wrapper class info provider. Causing a segfault when a heapdump was taken. This has been added, and the label_ set to the given provider name so each instance can be identified. The id will not be set of the passed object has no internal field count. As the class pointer cannot be retrieved from the object. In order to properly report the allocated size of each class, the new pure virtual method self_size() has been introduces. PR-URL: https://github.com/nodejs/io.js/pull/1896 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* Remove excessive copyright/license boilerplateisaacs2015-01-121-21/+0
| | | | | | | The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
* async-wrap: explicitly pass parentTrevor Norris2014-12-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | When instantiating a new AsyncWrap allow the parent AsyncWrap to be passed. This is useful for cases like TCP incoming connections, so the connection can be tied to the server receiving the connection. Because the current architecture instantiates the *Wrap inside a v8::FunctionCallback, the parent pointer is currently wrapped inside a new v8::External every time and passed as an argument. This adds ~80ns to instantiation time. A future optimization would be to add the v8::External as the data field when creating the v8::FunctionTemplate, change the pointer just before making the call then NULL'ing it out afterwards. This adds enough code complexity that it will not be attempted until the current approach demonstrates it is a bottle neck. PR-URL: https://github.com/joyent/node/pull/8110 Signed-off-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com> Reviewed-by: Alexis Campailla <alexis@janeasystems.com> Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
* src: don't use class specific Unwrap methodsTrevor Norris2013-10-291-1/+0
| | | | Instead use the template functions in util.h.
* src: add multi-context supportBen Noordhuis2013-09-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | | This commit makes it possible to use multiple V8 execution contexts within a single event loop. Put another way, handle and request wrap objects now "remember" the context they belong to and switch back to that context when the time comes to call into JS land. This could have been done in a quick and hacky way by calling v8::Object::GetCreationContext() on the wrap object right before making a callback but that leaves a fairly wide margin for bugs. Instead, we make the context explicit through a new Environment class that encapsulates everything (or almost everything) that belongs to the context. Variables that used to be a static or a global are now members of the aforementioned class. An additional benefit is that this approach should make it relatively straightforward to add full isolate support in due course. There is no JavaScript API yet but that will be added in the near future. This work was graciously sponsored by GitHub, Inc.
* src: lint c++ codeFedor Indutny2013-07-311-3/+3
|
* lib, src: upgrade after v8 api changeBen Noordhuis2013-07-061-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big commit that touches just about every file in the src/ directory. The V8 API has changed in significant ways. The most important changes are: * Binding functions take a const v8::FunctionCallbackInfo<T>& argument rather than a const v8::Arguments& argument. * Binding functions return void rather than v8::Handle<v8::Value>. The return value is returned with the args.GetReturnValue().Set() family of functions. * v8::Persistent<T> no longer derives from v8::Handle<T> and no longer allows you to directly dereference the object that the persistent handle points to. This means that the common pattern of caching oft-used JS values in a persistent handle no longer quite works, you first need to reconstruct a v8::Local<T> from the persistent handle with the Local<T>::New(isolate, persistent) factory method. A handful of (internal) convenience classes and functions have been added to make dealing with the new API a little easier. The most visible one is node::Cached<T>, which wraps a v8::Persistent<T> with some template sugar. It can hold arbitrary types but so far it's exclusively used for v8::Strings (which was by far the most commonly cached handle type.)
* process: abstract out HandleToStreamFedor Indutny2013-06-151-1/+1
| | | | | Originally contributed by @tjfontaine, but modified to be faster and more generic.
* core: use proper #include directivesBen Noordhuis2012-03-101-1/+1
|
* cluster: support passing of named pipesBen Noordhuis2012-03-091-0/+1
| | | | | | | | | Fixes triggered assertion: Assertion failed: (0 && "bad address family"), function GetPeerName, file ../src/tcp_wrap.cc, line 237. Fixes #2870.
* binding for uv_pipe_pending_instancesIgor Zinkovsky2011-12-011-0/+4
|
* Add missing copyright headersRyan Dahl2011-11-021-0/+21
|
* uv_write2 uv_read2_start bindingRyan Dahl2011-10-061-1/+1
|
* Wrap uv_pipe_open, implement net.Stream(fd);Ryan Dahl2011-09-121-0/+1
| | | | Fixes simple/test-child-process-ipc on unix.
* add wrapper for uv_spawnRyan Dahl2011-07-291-0/+32
process.binding('process_wrap')