Created
December 10, 2012 21:55
-
-
Save igm/4253724 to your computer and use it in GitHub Desktop.
Active Connection Guards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (c *conn) activeConnectionGuard(conn_closed <-chan bool) { | |
| for { | |
| select { | |
| case httpTx := <-c.httpTransactions: | |
| httpTx.writePrelude(httpTx.rw) | |
| httpTx.writeClose(httpTx.rw, 2010, "Another connection still open") | |
| httpTx.done <- true | |
| case <-conn_closed: | |
| return | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment