MCPcopy
hub / github.com/gorilla/websocket / TestHandshakeTimeout

Function TestHandshakeTimeout

client_server_test.go:373–387  ·  client_server_test.go::TestHandshakeTimeout
(t *testing.T)

Source from the content-addressed store, hash-verified

371func (c *requireDeadlineNetConn) RemoteAddr() net.Addr { return c.c.RemoteAddr() }
372
373func TestHandshakeTimeout(t *testing.T) {
374 s := newServer(t)
375 defer s.Close()
376
377 d := cstDialer
378 d.NetDial = func(n, a string) (net.Conn, error) {
379 c, err := net.Dial(n, a)
380 return &requireDeadlineNetConn{c: c, t: t}, err
381 }
382 ws, _, err := d.Dial(s.URL, nil)
383 if err != nil {
384 t.Fatal("Dial:", err)
385 }
386 ws.Close()
387}
388
389func TestHandshakeTimeoutInContext(t *testing.T) {
390 s := newServer(t)

Callers

nothing calls this directly

Calls 3

newServerFunction · 0.85
DialMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected