Skip to content

Commit

Permalink
Document the method, Update README.md for 1.2.1, Update version in pa…
Browse files Browse the repository at this point in the history
…ckage.json to 1.2.1
  • Loading branch information
Stephen Vickers committed Jul 14, 2017
1 parent b4c96f1 commit 939da34
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,24 @@ other outstanding ping requests.
});
}

## session.getSocket ()

The `getSocket()` method returns the underlying `Socket` instance used by
the session. Refer to the [raw-socket][raw-socket] module for documentation
related to the `Socket` class.

In the following example the network interface from which to send ICMP messages
is set:

var raw = require("raw-socket") // Required for access to constants

var level = raw.SocketLevel.SOL_SOCKET
var option = raw.SocketOption.SO_BINDTODEVICE

var iface = Buffer.from("eth0")

session.getSocket().setOption(level, option, iface, iface.length)

## session.pingHost (target, callback)

The `pingHost()` method sends a ping request to a remote host.
Expand Down Expand Up @@ -478,6 +496,10 @@ Bug reports should be sent to <stephen.vickers.sv@gmail.com>.
* The `_expandConstantObject()` function was declaring variables with global
scope

## Version 1.2.1 - 14/07/2017

* Document the `Socket.getSocket()` method

# Roadmap

Suggestions and requirements should be sent to <stephen.vickers.sv@gmail.com>.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "net-ping",
"version": "1.2.0",
"version": "1.2.1",
"description": "Ping and trace route to many hosts at once.",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 939da34

Please sign in to comment.