diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2012-05-10 14:14:22 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2012-05-10 14:14:22 -0700 |
commit | 156669c28bc62bfddbd5625c4bb4c1f8da94802b (patch) | |
tree | 074ea57dd044a9bed306464af8c9f141bdf0ca19 /doc | |
parent | 3d3e69c6e43f6431969e072e78df43b0ab73c48d (diff) | |
download | luasocket-156669c28bc62bfddbd5625c4bb4c1f8da94802b.tar.gz luasocket-156669c28bc62bfddbd5625c4bb4c1f8da94802b.tar.bz2 luasocket-156669c28bc62bfddbd5625c4bb4c1f8da94802b.zip |
socket.connect now implemented in the C core
This avoid socket.lua duplicating the iteration over the results
of getaddrinfo(). Some problems with the C implementation not
initializing sockets or the luasocket family have also been fixed,
and error reporting made more robust.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/reference.html | 2 | ||||
-rw-r--r-- | doc/socket.html | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/doc/reference.html b/doc/reference.html index f069d47..e9bb5eb 100644 --- a/doc/reference.html +++ b/doc/reference.html | |||
@@ -145,6 +145,8 @@ Support, Manual"> | |||
145 | <blockquote> | 145 | <blockquote> |
146 | <a href="socket.html#bind">bind</a>, | 146 | <a href="socket.html#bind">bind</a>, |
147 | <a href="socket.html#connect">connect</a>, | 147 | <a href="socket.html#connect">connect</a>, |
148 | <a href="socket.html#connect">connect4</a>, | ||
149 | <a href="socket.html#connect">connect6</a>, | ||
148 | <a href="socket.html#debug">_DEBUG</a>, | 150 | <a href="socket.html#debug">_DEBUG</a>, |
149 | <a href="dns.html#dns">dns</a>, | 151 | <a href="dns.html#dns">dns</a>, |
150 | <a href="socket.html#gettime">gettime</a>, | 152 | <a href="socket.html#gettime">gettime</a>, |
diff --git a/doc/socket.html b/doc/socket.html index dcf8b61..b9303cb 100644 --- a/doc/socket.html +++ b/doc/socket.html | |||
@@ -73,14 +73,19 @@ set to <tt><b>true</b></tt>. | |||
73 | <!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 73 | <!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |
74 | 74 | ||
75 | <p class=name id=connect> | 75 | <p class=name id=connect> |
76 | socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b> | 76 | socket.<b>connect[46](</b>address, port [, locaddr] [, locport] [, family]<b>)</b> |
77 | </p> | 77 | </p> |
78 | 78 | ||
79 | <p class=description> | 79 | <p class=description> |
80 | This function is a shortcut that creates and returns a TCP client object | 80 | This function is a shortcut that creates and returns a TCP client object |
81 | connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally, | 81 | connected to a remote <tt>address</tt> at a given <tt>port</tt>. Optionally, |
82 | the user can also specify the local address and port to bind | 82 | the user can also specify the local address and port to bind |
83 | (<tt>locaddr</tt> and <tt>locport</tt>). | 83 | (<tt>locaddr</tt> and <tt>locport</tt>), or restrict the socket family |
84 | to "<tt>inet</tt>" or "<tt>inet6</tt>". | ||
85 | Without specifying <tt>family</tt> to <tt>connect</tt>, whether a tcp or tcp6 | ||
86 | connection is created depends on your system configuration. Two variations | ||
87 | of connect are defined as simple helper functions that restrict the | ||
88 | <tt>family</tt>, <tt>socket.connect4</tt> and <tt>socket.connect6</tt>. | ||
84 | </p> | 89 | </p> |
85 | 90 | ||
86 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> | 91 | <!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> |