conn represents a secured connection. It implements the net.Conn interface.
| 114 | |
| 115 | // conn represents a secured connection. It implements the net.Conn interface. |
| 116 | type conn struct { |
| 117 | net.Conn |
| 118 | reader readyreader.Reader |
| 119 | crypto ALTSRecordCrypto |
| 120 | // buf holds data that has been read from the connection and decrypted, |
| 121 | // but has not yet been returned by Read. It is a sub-slice of protected. |
| 122 | buf []byte |
| 123 | payloadLengthLimit int |
| 124 | // protectedHandle buffer holds data read from the network but have not yet |
| 125 | // been decrypted. This data might not compose a complete frame. |
| 126 | // |
| 127 | // The buffer pointer to points to a buffer from the readBufPool. The handle |
| 128 | // should only be returned to the pool once nextFrame and buf are empty. |
| 129 | protectedHandle *[]byte |
| 130 | // nextFrame stores the next frame (in protected buffer) info. |
| 131 | nextFrame []byte |
| 132 | // overhead is the calculated overhead of each frame. |
| 133 | overhead int |
| 134 | constPool constBufferPool // stored as a field to avoid heap allocations. |
| 135 | } |
| 136 | |
| 137 | // NewConn creates a new secure channel instance given the other party role and |
| 138 | // handshaking result. |
nothing calls this directly
no outgoing calls
no test coverage detected