Transport has built in magic wrt keep alive behavior. I intentionally wrote it like this to make sure the behavior is explicit and there's no magic in the test.

-dave

On Apr 30, 2013, at 10:55 AM, Jonathan Rudenberg <notifications@github.com> wrote:

> In keep_alive_test.go:
> 
> > +}
> > +
> > +func TestKeepAlive(t *testing.T){
> > +	// Startup a basic server and get the port
> > +	pipeline := NewPipeline()
> > +	srv := NewServer(0, pipeline)
> > +	go func(){
> > +		srv.ListenAndServe()
> > +	}()
> > +	<- srv.AcceptReady
> > +	serverPort := srv.Port()
> > +	
> > +	// Connect and make some requests
> > +	// Not using http.Client because transport does too many magics
> > +	for _, test := range keepAliveTestData {
> > +		conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%v", serverPort))
> Instead of manually dialing, writing, and reading, you could use http.Transport.RoundTrip.
> 
> —
> Reply to this email directly or view it on GitHub.