starts actually starts listening on a local TCP port, and spawns a goroutine to handle new connections.
(ctx context.Context)
| 107 | // starts actually starts listening on a local TCP port, and spawns a goroutine |
| 108 | // to handle new connections. |
| 109 | func (ts *testServer) start(ctx context.Context) error { |
| 110 | lis, err := net.Listen("tcp", "localhost:0") |
| 111 | if err != nil { |
| 112 | return err |
| 113 | } |
| 114 | ts.lis = lis |
| 115 | ts.address = lis.Addr().String() |
| 116 | go ts.handleConn(ctx) |
| 117 | return nil |
| 118 | } |
| 119 | |
| 120 | // handleConn accepts a new raw connection, and invokes the test provided |
| 121 | // handshake function to perform TLS handshake, and returns the result on the |
no test coverage detected