Skip to content

Commit

Permalink
fixed couple of api details in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Feb 24, 2015
1 parent fe68ec7 commit 923b3bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ We can optionally initialise telehash network with options:
respondToBroadcasts: false,
interface: "eth0", /* interface name, or ip address, or "ALL"
port: 20000,
socket: require("dgram").createSocket("udp4")
socket: require("dgram").createSocket("udp4").bind(20000)
/* socket can be a normal node dgram sockket or any object
that has a dgram socket API. interface and port are ignored if we pass in a socket*/
},function(err){
Expand Down Expand Up @@ -87,7 +87,7 @@ Returns the mode we are running in. There are three modes:
telehash.MODE.FULL

The default mode if not set during initialising is LISTENER
See [mode.js](https://github.com/mnaamani/node-telehash/blob/master/lib/mode.js) for explanation of each mode.
See [mode.js](https://github.com/mnaamani/node-telehash/blob/master/lib/modes.js) for explanation of each mode.

### telehash.address()
Returns our address used in the DHT.
Expand Down Expand Up @@ -198,11 +198,11 @@ To send a response:
See [listen.js](https://github.com/mnaamani/node-telehash/blob/master/examples/listen.js) for a detailed example.


### telehash.connect(end_name, [discard_response] )
### telehash.connect(end_name)
`connect()` will return a connector object. In the background the connector will use the DHT to
find anyone listening for the end_name.

var connector = telehash.connect( 'echo', false );
var connector = telehash.connect("echo");

### connector.send( message, [callback, timeout_s] )

Expand Down

0 comments on commit 923b3bd

Please sign in to comment.