Skip to content

Commit

Permalink
Document net.Socket() constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
koichik authored and ry committed Mar 10, 2011
1 parent 62f06fb commit 4e047d3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/net.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ and passed to the user through the `'connection'` event of a server.

`net.Socket` instances are EventEmitters with the following events:

#### new net.Socket([options])

Construct a new socket object.

`options` is an object with the following defaults:

{ fd: null
type: null
allowHalfOpen: false
}

`fd` allows you to specify the existing file descriptor of socket. `type`
specified underlying protocol. It can be `'tcp4'`, `'tcp6'`, or `'unix'`.
About `allowHalfOpen`, refer to `createServer()` and `'end'` event.

#### socket.connect(port, [host], [callback])
#### socket.connect(path, [callback])

Expand Down

0 comments on commit 4e047d3

Please sign in to comment.