-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sockopt API • convenience methods for `get/setsockopt()` an interface to nanomsg socket options by way of: `socket.option(param)` or `socket.option()` passing a param sets that, while no param gets that. *a few caveats will be referenced in forthcoming docs it’s the simple interface i wrote in nanomsg.iojs covering: • tcpnodelay • linger • sndbuf • rcvbuf • sndtimeo • rcvtimeo • reconn • maxreconn • sndprio • rcvprio test: socket.tcpnodelay(boolean) document the api opts initializer also added some semicolons add note on address strings act like a getter, not a setter delete var domain test: sockoptapi.js semicolons docs: update raw opt use more nn.Err() remove nn.Strerr() C++ function, use nn.Err() maintain byte length check during nn_recv() operation fixes #47 with a necessary check removed in c0336f19cd6376607 31f32911d1f31b09e6f7f8f • if nn_recv() errors setting len to -1, node buffer library will accordingly refuse to allocate (malloc or smalloc) an impossible size in memory test: set sockopts when starting the socket unorthodox symbol fix: rvcprio() opval dry it out a bit docs: rcvbuf and sndbuf unit is size in bytes adding Makefile after pulling down run git submodule update - -init: when building the repo on unix for node/iojs versions just go: nvm use $VERSION && make full make full removes the build and node_modules directory first then it rebuilds the project compiling sources then it runs the test suite. if you only want to rebuild for a different version just go: make clean && make we’ll probably want to uncomment the perf stuff once that’s setup docs: the Makefile docs: move contributing under test section js: put sockopt API methods onto Socket prototype js: line up the o's (ocd) docs: also add size in bytes to top links js: partial function application & test: RCVPRIO • adds TODO: Issue #50 comment on line 19 • rewrite opts check for RAW & remove redundant error check - RAW option now more consistent with its description in docs • partial function application: tighten up opts API methods • test: RCVPRIO, ensure symbol test fails for the missing symbol js: clean up, opt function context minor bump bump version
- Loading branch information
Showing
9 changed files
with
451 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ libtool | |
nanocat | ||
perf | ||
.libs | ||
Makefile | ||
v8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.PHONY: clean check test perf bench full | ||
|
||
ALL: | ||
npm i | ||
|
||
check: | ||
npm t | ||
|
||
test: | ||
npm t | ||
|
||
clean: | ||
rm -fr build && rm -rf node_modules | ||
|
||
#perf: | ||
# node perf/local_lat.js tcp://127.0.0.1:5555 1 100000& node perf/remote_lat.js tcp://127.0.0.1:5555 1 100000 | ||
# node perf/local_thr.js tcp://127.0.0.1:5556 1 100000& node perf/remote_thr.js tcp://127.0.0.1:5556 1 100000# | ||
|
||
#bench: | ||
# node perf/local_lat.js tcp://127.0.0.1:5555 10 1000& node perf/remote_lat.js tcp://127.0.0.1:5555 10 1000 | ||
# node perf/local_thr.js tcp://127.0.0.1:5556 10 100000& node perf/remote_thr.js tcp://127.0.0.1:5556 10 100000 | ||
|
||
full: | ||
rm -fr build && rm -rf node_modules | ||
npm i && npm t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### socket addresses | ||
|
||
*(Strings)* | ||
|
||
Socket address strings consist of two parts as follows: `transport://address`. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol. | ||
* *TCP transport mechanism*: `'tcp://127.0.0.1:65000'` When binding a TCP socket, address of the form `tcp://interface:port` should be used. Port is the TCP port number to use. Interface is either: `IPv4` or `IPv6` address of a local network interface, or DNS name of the remote box. It is possible to use named interfaces like `eth0`. For more info see [nanomsg docs](http://nanomsg.org/v0.5/nn_tcp.7.html). | ||
* *in-process transport mechanism*: `'inproc://bar'` The `inproc` transport allows messages between threads or modules inside a process. In-process address is an arbitrary case-sensitive string preceded by `inproc://` protocol specifier. All in-process addresses are visible from any module within the process. They are not visible from outside of the process. The overall buffer size for an inproc connection is determined by `rcvbuf` socket option on the receiving end of the connection. `sndbuf` is ignored. In addition to the buffer, one message of arbitrary size will fit into the buffer. That way, even messages larger than the buffer can be transfered via inproc connection. | ||
* *inter-process transport mechanism*: `'ipc:///tmp/foo.ipc'` The `ipc` transport allows for sending messages between processes within a single box. The nanomsg implementation uses native IPC mechanism provided by the local operating system and the IPC addresses are thus OS-specific. On POSIX-compliant systems, UNIX domain sockets are used and IPC addresses are file references. Note that both relative (`ipc://test.ipc`) and absolute (`ipc:///tmp/test.ipc`) paths may be used. Also note that access rights on the IPC files must be set in such a way that the appropriate applications can actually use them. On Windows, named pipes are used for IPC. The Windows IPC address is an arbitrary case-insensitive string containing any character except for backslash: internally, address `ipc://test` means that named pipe `\\.\pipe\test` will be used. |
Oops, something went wrong.