Compare commits

...

3 Commits

Author SHA1 Message Date
Egil Hjelmeland
9b5187801c
Merge ccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f into 23241717bf91c4317065828bedafd05ebb97c1ef 2024-03-10 04:19:01 -06:00
Thijs Schreijer
23241717bf
fix(docs): link to included LTN documents (#426) 2024-03-05 23:18:24 +03:00
Egil Hjelmeland
ccef3bc4e2 Changed return text for ETIMEDOUT/ WSAETIMEDOUT
Changed return text for ETIMEDOUT/ WSAETIMEDOUT to “connection timeout”.

This is needed for the application to be able tell to the difference between timeout of TCP connection (ETIMEDOUT/ WSAETIMEDOUT) and a normal return from a non-blocking socket (error codes EAGAIN/WSAEWOULDBLOCK). Both situations returned the text “timeout”.
2015-09-03 15:24:22 +02:00
3 changed files with 11 additions and 2 deletions

View File

@ -40,7 +40,7 @@ Pump, Support, Library">
<h2 id="ltn12">LTN12</h2> <h2 id="ltn12">LTN12</h2>
<p> The <tt>ltn12</tt> namespace implements the ideas described in <p> The <tt>ltn12</tt> namespace implements the ideas described in
<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks"> <a href="https://github.com/lunarmodules/luasocket/blob/master/ltn012.md">
LTN012, Filters sources and sinks</a>. This manual simply describes the LTN012, Filters sources and sinks</a>. This manual simply describes the
functions. Please refer to the LTN for a deeper explanation of the functions. Please refer to the LTN for a deeper explanation of the
functionality provided by this module. functionality provided by this module.

View File

@ -164,6 +164,9 @@ Creates and returns a <em>clean</em>
<a href="#try"><tt>try</tt></a> <a href="#try"><tt>try</tt></a>
function that allows for cleanup before the exception function that allows for cleanup before the exception
is raised. is raised.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">
@ -207,6 +210,9 @@ Converts a function that throws exceptions into a safe function. This
function only catches exceptions thrown by the <a href="#try"><tt>try</tt></a> function only catches exceptions thrown by the <a href="#try"><tt>try</tt></a>
and <a href="#newtry"><tt>newtry</tt></a> functions. It does not catch normal and <a href="#newtry"><tt>newtry</tt></a> functions. It does not catch normal
Lua errors. Lua errors.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">
@ -425,6 +431,9 @@ socket.<b>try(</b>ret<sub>1</sub> [, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b
Throws an exception in case <tt>ret<sub>1</sub></tt> is falsy, using Throws an exception in case <tt>ret<sub>1</sub></tt> is falsy, using
<tt>ret<sub>2</sub></tt> as the error message. The exception is supposed to be caught <tt>ret<sub>2</sub></tt> as the error message. The exception is supposed to be caught
by a <a href="#protect"><tt>protect</tt></a>ed function only. by a <a href="#protect"><tt>protect</tt></a>ed function only.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">

View File

@ -12,7 +12,7 @@
#define PIE_CONNREFUSED "connection refused" #define PIE_CONNREFUSED "connection refused"
#define PIE_CONNABORTED "closed" #define PIE_CONNABORTED "closed"
#define PIE_CONNRESET "closed" #define PIE_CONNRESET "closed"
#define PIE_TIMEDOUT "timeout" #define PIE_TIMEDOUT "connection timeout"
#define PIE_AGAIN "temporary failure in name resolution" #define PIE_AGAIN "temporary failure in name resolution"
#define PIE_BADFLAGS "invalid value for ai_flags" #define PIE_BADFLAGS "invalid value for ai_flags"
#define PIE_BADHINTS "invalid value for hints" #define PIE_BADHINTS "invalid value for hints"