Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Simper <kevin.simper@gmail.com>2014-08-03 04:27:02 +0400
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-08-07 01:46:18 +0400
commit70cc9968f667ce110a3a99db6a24b64eb8a3c32e (patch)
tree8b2d076df8748859efafd4e8abe013451c7824f9
parent53b4accb6e5747b156be91a2b90f42607e33a7cc (diff)
doc: clarify factory methods for net.Socket
-rw-r--r--doc/api/net.markdown10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/api/net.markdown b/doc/api/net.markdown
index 7d23b680c9d..f7f044d87f5 100644
--- a/doc/api/net.markdown
+++ b/doc/api/net.markdown
@@ -53,9 +53,13 @@ Use `nc` to connect to a UNIX domain socket server:
## net.connect(options, [connectionListener])
## net.createConnection(options, [connectionListener])
-Constructs a new socket object and opens the socket to the given location.
+A factory method, which returns a new ['net.Socket'](#net_class_net_socket)
+and connects to the supplied address and port.
+
When the socket is established, the ['connect'][] event will be emitted.
+Has the same events as ['net.Socket'](#net_class_net_socket).
+
For TCP sockets, `options` argument should be an object which specifies:
- `port`: Port the client should connect to (Required).
@@ -106,6 +110,8 @@ Creates a TCP connection to `port` on `host`. If `host` is omitted,
The `connectListener` parameter will be added as an listener for the
['connect'][] event.
+Is a factory method which returns a new ['net.Socket'](#net_class_net_socket).
+
## net.connect(path, [connectListener])
## net.createConnection(path, [connectListener])
@@ -113,6 +119,8 @@ Creates unix socket connection to `path`.
The `connectListener` parameter will be added as an listener for the
['connect'][] event.
+A factory method which returns a new ['net.Socket'](#net_class_net_socket).
+
## Class: net.Server
This class is used to create a TCP or UNIX server.