FINCLOSE and NOFINCLOSE (JANUS DEFINE parameters): Difference between revisions
mNo edit summary |
m (add displaytitle) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:FINCLOSE | {{DISPLAYTITLE:FINCLOSE and NOFINCLOSE}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Sockets close-connection characteristics</span> | ||
<var>FINCLOSE</var> | <var>FINCLOSE</var> and <var>NOFINCLOSE</var> are parameters on <var>[[JANUS DEFINE]]</var>, which defines and sets characteristics of a Janus port. | ||
These parameters affect how <var class="product">[[Janus Sockets]]</var> applications respond to a closed connection. If the remote host closes the connection, even if it does so "cleanly" (that is with FIN rather than RESET), <var class="product">Janus Sockets</var> closes the connection immediately. This is useful in situations where FIN is as good as RESET for rendering a connection unusable, and where it's important to know that a FIN has been sent to avoid wasted processing or even a hung connection. | |||
If <var>FINCLOSE</var> is not specified, or if <var> | If <var>FINCLOSE</var> is not specified, or if <var>NOFINCLOSE</var> is specified, a <var class="product">Janus Sockets</var> thread remains in-use and does not recognize a FIN indicator sent by a remote partner until the <var class="product">Janus Sockets</var> application tries to receive data on the connection. | ||
A situation where <var>FINCLOSE</var> processing is useful is a | A situation where <var>FINCLOSE</var> processing is useful is a <var class="product">Janus Sockets</var> application communicating with a web server that is using a keep-alive facility (multiple requests over the same TCP/IP connection). The web server could close the connection between any pair of requests with a FIN. Without <var>FINCLOSE</var> processing, a Janus thread that connected to the web server and received such a FIN would remain in use until the <var class="product">Janus Sockets</var> application tried to receive data on the connection and then noticed the closed connection. | ||
If not set on the port definition, you can make <var>FINCLOSE</var> or <var>NOFINCLOSE</var> specific to a [[$Sock_Conn]] call or to a Socket object New constructor. | If not set on the port definition, you can make <var>FINCLOSE</var> or <var>NOFINCLOSE</var> specific to a <var>[[$Sock_Conn]]</var> call or to a <var>[[Socket class|Socket]]</var> object <var>[[New (Socket constructor)|New]]</var> constructor. | ||
The <var>FINCLOSE</var> and <var>NOFINCLOSE</var> parameters are valid only for CLSOCK and SRVSOCK ports. | The <var>FINCLOSE</var> and <var>NOFINCLOSE</var> parameters are valid only for <var>[[JANUS DEFINE#type|CLSOCK]]</var> and <var>[[JANUS DEFINE#type|SRVSOCK]]</var> ports. | ||
== | ==See also== | ||
<ul> | |||
<li>[[List of Janus commands]] | |||
<li>[[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]] | |||
</ul> | |||
[[Category:JANUS DEFINE parameters|FINCLOSE]] | [[Category:JANUS DEFINE parameters|FINCLOSE]] |
Latest revision as of 17:57, 8 June 2016
Sockets close-connection characteristics
FINCLOSE and NOFINCLOSE are parameters on JANUS DEFINE, which defines and sets characteristics of a Janus port.
These parameters affect how Janus Sockets applications respond to a closed connection. If the remote host closes the connection, even if it does so "cleanly" (that is with FIN rather than RESET), Janus Sockets closes the connection immediately. This is useful in situations where FIN is as good as RESET for rendering a connection unusable, and where it's important to know that a FIN has been sent to avoid wasted processing or even a hung connection.
If FINCLOSE is not specified, or if NOFINCLOSE is specified, a Janus Sockets thread remains in-use and does not recognize a FIN indicator sent by a remote partner until the Janus Sockets application tries to receive data on the connection.
A situation where FINCLOSE processing is useful is a Janus Sockets application communicating with a web server that is using a keep-alive facility (multiple requests over the same TCP/IP connection). The web server could close the connection between any pair of requests with a FIN. Without FINCLOSE processing, a Janus thread that connected to the web server and received such a FIN would remain in use until the Janus Sockets application tried to receive data on the connection and then noticed the closed connection.
If not set on the port definition, you can make FINCLOSE or NOFINCLOSE specific to a $Sock_Conn call or to a Socket object New constructor.
The FINCLOSE and NOFINCLOSE parameters are valid only for CLSOCK and SRVSOCK ports.