~ubuntu-branches/ubuntu/trusty/nodejs/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/api/net.markdown

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-12-12 23:04:07 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20131212230407-xfa6gka4c6oatsx1
Tags: 0.10.23~dfsg1-1
* Upstream update.
* Refresh patches, remove 1005 patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
To connect on the socket `/tmp/echo.sock` the second line would just be
97
97
changed to
98
98
 
99
 
    var client = net.connect({path: '/tmp/echo.sock'},
 
99
    var client = net.connect({path: '/tmp/echo.sock'});
100
100
 
101
101
## net.connect(port, [host], [connectListener])
102
102
## net.createConnection(port, [host], [connectListener])
281
281
`options` is an object with the following defaults:
282
282
 
283
283
    { fd: null
284
 
      type: null
285
 
      allowHalfOpen: false
 
284
      allowHalfOpen: false,
 
285
      readable: false,
 
286
      writable: false
286
287
    }
287
288
 
288
 
`fd` allows you to specify the existing file descriptor of socket. `type`
289
 
specified underlying protocol. It can be `'tcp4'`, `'tcp6'`, or `'unix'`.
 
289
`fd` allows you to specify the existing file descriptor of socket.
 
290
Set `readable` and/or `writable` to `true` to allow reads and/or writes on this
 
291
socket (NOTE: Works only when `fd` is passed).
290
292
About `allowHalfOpen`, refer to `createServer()` and `'end'` event.
291
293
 
292
294
### socket.connect(port, [host], [connectListener])