conn, dialErr := net.Dial("tcp", LISTEN_ADDRESS)
if dialErr != nil {
b.Fatalf("Error dialing server: %s", dialErr)
}
spdyConn, spdyErr := NewConnection(conn, false)
if spdyErr != nil {
b.Fatalf("Error creating spdy connection: %s", spdyErr)
}
go spdyConn.Serve(MirrorStreamHandler)
stream, err := spdyConn.CreateStream(http.Header{}, nil, false)
writer := make([]byte, 1024)
stream.Write(writer)
if err != nil {
panic(err)
}
reader := make([]byte, 1024)
stream.Read(reader)
closeErr := spdyConn.Close()
if closeErr != nil {
b.Fatalf("Error closing connection: %s, closeErr")
}
This code should soft deadlock, or at least, that's what I was seeing in the runs I made.
if you add a stream.Close() after the stream.Read() call, it exhibits the desired behavior.
This code should soft deadlock, or at least, that's what I was seeing in the runs I made.
if you add a
stream.Close()after thestream.Read()call, it exhibits the desired behavior.