FINCLOSE and NOFINCLOSE (JANUS DEFINE parameters): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:
<var>FINCLOSE</var> is a parameter on [[JANUS DEFINE]], which defines and sets characteristics of a Janus port. See the [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].
<var>FINCLOSE</var> is a parameter on [[JANUS DEFINE]], which defines and sets characteristics of a Janus port. See the [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].


This parameter affects 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.  
This parameter affects 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 <var>FINCLOSE</var> is not specified, or if <var>[[NOFINCLOSE (JANUS DEFINE parameter)|NOFINCLOSE]]</var> 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.  
If <var>FINCLOSE</var> is not specified, or if <var>NOFINCLOSE</var> 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 <var>FINCLOSE</var> 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 <var>FINCLOSE</var> 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.  
A situation where <var>FINCLOSE</var> 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 <var>FINCLOSE</var> 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 <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 CLSOCK and SRVSOCK ports.

Revision as of 21:54, 24 February 2012

<section begin="desc" />Sockets close-connection characteristics<section end="desc" />

FINCLOSE is a parameter on JANUS DEFINE, which defines and sets characteristics of a Janus port. See the List of JANUS DEFINE parameters.

This parameter affects 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.

References

See: List of Janus commands | List of JANUS DEFINE parameters.