| <head> |
| <title>flush(9P) - Plan 9 from User Space</title> |
| <meta content="text/html; charset=utf-8" http-equiv=Content-Type> |
| </head> |
| <body bgcolor=#ffffff> |
| <table border=0 cellpadding=0 cellspacing=0 width=100%> |
| <tr height=10><td> |
| <tr><td width=20><td> |
| <tr><td width=20><td><b>FLUSH(9P)</b><td align=right><b>FLUSH(9P)</b> |
| <tr><td width=20><td colspan=2> |
| <br> |
| <p><font size=+1><b>NAME </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| flush – abort a message<br> |
| |
| </table> |
| <p><font size=+1><b>SYNOPSIS </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <i>size</i>[4] <tt><font size=+1>Tflush</font></tt> <i>tag</i>[2] <i>oldtag</i>[2]<br> |
| <i>size</i>[4] <tt><font size=+1>Rflush</font></tt> <i>tag</i>[2]<br> |
| |
| </table> |
| <p><font size=+1><b>DESCRIPTION </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| When the response to a request is no longer needed, such as when |
| a user interrupts a process doing a <i>read</i>(9p), a <tt><font size=+1>Tflush</font></tt> request |
| is sent to the server to purge the pending response. The message |
| being flushed is identified by <i>oldtag</i>. The semantics of <tt><font size=+1>flush</font></tt> |
| depends on messages arriving in order. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| The server should answer the <tt><font size=+1>flush</font></tt> message immediately. If it |
| recognizes <i>oldtag</i> as the tag of a pending transaction, it should |
| abort any pending response and discard that tag. In either case, |
| it should respond with an <tt><font size=+1>Rflush</font></tt> echoing the <i>tag</i> (not <i>oldtag</i>) |
| of the <tt><font size=+1>Tflush</font></tt> message. A <tt><font size=+1>Tflush</font></tt> can never be |
| responded to by an <tt><font size=+1>Rerror</font></tt> message. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| The server may respond to the pending request before responding |
| to the <tt><font size=+1>Tflush</font></tt>. It is possible for a client to send multiple <tt><font size=+1>Tflush</font></tt> |
| messages for a particular pending request. Each subsequent <tt><font size=+1>Tflush</font></tt> |
| must contain as <i>oldtag</i> the tag of the pending request (not a previous |
| <tt><font size=+1>Tflush</font></tt>). Should multiple <tt><font size=+1>Tflush</font></tt>es be |
| received for a pending request, they must be answered in order. |
| A <tt><font size=+1>Rflush</font></tt> for any of the multiple <tt><font size=+1>Tflush</font></tt>es implies an answer for |
| all previous ones. Therefore, should a server receive a request |
| and then multiple flushes for that request, it need respond only |
| to the last flush. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| When the client sends a <tt><font size=+1>Tflush</font></tt>, it must wait to receive the corresponding |
| <tt><font size=+1>Rflush</font></tt> before reusing <i>oldtag</i> for subsequent messages. If a response |
| to the flushed request is received before the <tt><font size=+1>Rflush</font></tt>, the client |
| must honor the response as if it had not been flushed, since the |
| completed request may signify a state |
| change in the server. For instance, <tt><font size=+1>Tcreate</font></tt> may have created a |
| file and <tt><font size=+1>Twalk</font></tt> may have allocated a fid. If no response is received |
| before the <tt><font size=+1>Rflush</font></tt>, the flushed transaction is considered to have |
| been canceled, and should be treated as though it had never been |
| sent. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| Several exceptional conditions are handled correctly by the above |
| specification: sending multiple flushes for a single tag, flushing |
| after a transaction is completed, flushing a <tt><font size=+1>Tflush</font></tt>, and flushing |
| an invalid tag.<br> |
| |
| </table> |
| <p><font size=+1><b>ENTRY POINTS </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| The <a href="../man3/9pclient.html"><i>9pclient</i>(3)</a> library does not generate <tt><font size=+1>flush</font></tt> transactions.. |
| <a href="../man4/9pserve.html"><i>9pserve</i>(4)</a> generates <tt><font size=+1>flush</font></tt> transactions to cancel transactions |
| pending when a client hangs up.<br> |
| |
| </table> |
| |
| <td width=20> |
| <tr height=20><td> |
| </table> |
| <!-- TRAILER --> |
| <table border=0 cellpadding=0 cellspacing=0 width=100%> |
| <tr height=15><td width=10><td><td width=10> |
| <tr><td><td> |
| <center> |
| <a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a> |
| </center> |
| </table> |
| <!-- TRAILER --> |
| </body></html> |