Skip to content

Instantly share code, notes, and snippets.

@makoto
Created July 26, 2010 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makoto/491379 to your computer and use it in GitHub Desktop.
Save makoto/491379 to your computer and use it in GitHub Desktop.
[tmp]$ 8g websocket2.go ; 8l -o websocket2 websocket2.8 ; ./websocket2
0
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
panic: Dial failed: read tcp 127.0.0.1:5555: connection reset by peer
panic PC=0x10200c
runtime.panic+0x97 /Users/makoto/go/src/pkg/runtime/proc.c:1012
runtime.panic(0x0, 0x10203c)
main.main+0x17a /Users/makoto/tmp/websocket2.go:31
main.main()
mainstart+0xf /Users/makoto/go/src/pkg/runtime/386/asm.s:83
mainstart()
goexit /Users/makoto/go/src/pkg/runtime/proc.c:145
goexit()
goroutine 2113 [4]:
gosched+0x66 /Users/makoto/go/src/pkg/runtime/proc.c:542
gosched()
chanrecv+0x15f /Users/makoto/go/src/pkg/runtime/chan.c:364
chanrecv(0x7a3d30, 0xb873a0, 0x528ef, 0x11d820)
runtime.chanrecv1+0x37 /Users/makoto/go/src/pkg/runtime/chan.c:438
runtime.chanrecv1(0x7a3d00, 0x9195cc)
net.*pollServer·WaitRead+0x4d /Users/makoto/go/src/pkg/net/fd.go:248
net.*pollServer·WaitRead(0x7a3d00, 0x122580, 0x52fa1)
net.*netFD·Read+0x1be /Users/makoto/go/src/pkg/net/fd.go:354
net.*netFD·Read(0x11d860, 0x122580, 0x1000, 0x1000, 0xffffffff, ...)
net.*TCPConn·Read+0x6c /Users/makoto/go/src/pkg/net/tcpsock.go:89
net.*TCPConn·Read(0x122580, 0x911000, 0x1000, 0x1000, 0x0, ...)
bufio.*Reader·fill+0x1bf /Users/makoto/go/src/pkg/bufio/bufio.go:95
bufio.*Reader·fill(0x8143e0, 0x911000)
bufio.*Reader·ReadByte+0x63 /Users/makoto/go/src/pkg/bufio/bufio.go:148
bufio.*Reader·ReadByte(0x7c9690, 0x1, 0x301, 0x2)
websocket.*Conn·Read+0x4f /Users/makoto/go/src/pkg/websocket/websocket.go:56
websocket.*Conn·Read(0x7c9690, 0x1, 0x0, 0x0, 0x1, ...)
io.Copy+0x1c7 /Users/makoto/go/src/pkg/io/io.go:254
io.Copy(0xd4ad20, 0xaca000, 0x8000, 0x8000, 0x0, ...)
main.echoServer+0x7b /Users/makoto/tmp/websocket2.go:14
main.echoServer(0x172d20, 0xd4ad20)
websocket.Handler·ServeHTTP+0x968 /Users/makoto/go/src/pkg/websocket/server.go:165
websocket.Handler·ServeHTTP(0xd4ad20, 0x11, 0xb87900, 0x18)
http.*ServeMux·ServeHTTP+0x21c /Users/makoto/go/src/pkg/http/server.go:552
http.*ServeMux·ServeHTTP(0x1c00, 0x7a3ac0, 0xc3b460, 0x5)
http.*Conn·serve+0x73 /Users/makoto/go/src/pkg/http/server.go:333
http.*Conn·serve(0xfe838, 0x7a3ac0)
goexit /Users/makoto/go/src/pkg/runtime/proc.c:145
goexit()
goroutine 2112 [4]:
gosched+0x66 /Users/makoto/go/src/pkg/runtime/proc.c:542
gosched()
chanrecv+0x15f /Users/makoto/go/src/pkg/runtime/chan.c:364
chanrecv(0x7688b0, 0xb87120, 0x528ef, 0x11d820)
runtime.chanrecv1+0x37 /Users/makoto/go/src/pkg/runtime/chan.c:438
runtime.chanrecv1(0x768880, 0x8f26cc)
net.*pollServer·WaitRead+0x4d /Users/makoto/go/src/pkg/net/fd.go:248
net.*pollServer·WaitRead(0x768880, 0xbb2d00, 0x52fa1)
net.*netFD·Read+0x1be /Users/makoto/go/src/pkg/net/fd.go:354
net.*netFD·Read(0x11d860, 0xbb2d00, 0x1000, 0x1000, 0xffffffff, ...)
net.*TCPConn·Read+0x6c /Users/makoto/go/src/pkg/net/tcpsock.go:89
net.*TCPConn·Read(0xbb2d00, 0xa7c000, 0x1000, 0x1000, 0x0, ...)
bufio.*Reader·fill+0x1bf /Users/makoto/go/src/pkg/bufio/bufio.go:95
bufio.*Reader·fill(0x7199e0, 0xa7c000)
bufio.*Reader·ReadByte+0x63 /Users/makoto/go/src/pkg/bufio/bufio.go:148
bufio.*Reader·ReadByte(0x7c94e0, 0x1, 0x127, 0x8f31e0)
websocket.*Conn·Read+0x4f /Users/makoto/go/src/pkg/websocket/websocket.go:56
websocket.*Conn·Read(0x7c94e0, 0xffffffff, 0x0, 0x0, 0xcfe88, ...)
io.Copy+0x1c7 /Users/makoto/go/src/pkg/io/io.go:254
io.Copy(0xd4a4e0, 0x900000, 0x8000, 0x8000, 0x0, ...)
main.echoServer+0x7b /Users/makoto/tmp/websocket2.go:14
main.echoServer(0x172d20, 0xd4a4e0)
websocket.Handler·ServeHTTP+0x968 /Users/makoto/go/src/pkg/websocket/server.go:165
websocket.Handler·ServeHTTP(0xd4a4e0, 0x11, 0x813d00, 0x18)
http.*ServeMux·ServeHTTP+0x21c /Users/makoto/go/src/pkg/http/server.go:552
http.*ServeMux·ServeHTTP(0x1c00, 0xb40800, 0xe0f000, 0x5)
http.*Conn·serve+0x73 /Users/makoto/go/src/pkg/http/server.go:333
http.*Conn·serve(0xfe838, 0xb40800)
goexit /Users/makoto/go/src/pkg/runtime/proc.c:145
goexit()
goroutine 2111 [4]:
gosched+0x66 /Users/makoto/go/src/pkg/runtime/proc.c:542
gosched()
chanrecv+0x15f /Users/makoto/go/src/pkg/runtime/chan.c:364
chanrecv(0x7686b0, 0x813960, 0x528ef, 0x11d820)
runtime.chanrecv1+0x37 /Users/makoto/go/src/pkg/runtime/chan.c:438
runtime.chanrecv1(0x768680, 0x8f15cc)
net.*pollServer·WaitRead+0x4d /Users/makoto/go/src/pkg/net/fd.go:248
net.*pollServer·WaitRead(0x768680, 0xbb2e00, 0x52fa1)
net.*netFD·Read+0x1be /Users/makoto/go/src/pkg/net/fd.go:354
net.*netFD·Read(0x11d860, 0xbb2e00, 0x1000, 0x1000, 0xffffffff, ...)
net.*TCPConn·Read+0x6c /Users/makoto/go/src/pkg/net/tcpsock.go:89
net.*TCPConn·Read(0xbb2e00, 0xa7a000, 0x1000, 0x1000, 0x0, ...)
bufio.*Reader·fill+0x1bf /Users/makoto/go/src/pkg/bufio/bufio.go:95
bufio.*Reader·fill(0x719900, 0xa7a000)
bufio.*Reader·ReadByte+0x63 /Users/makoto/go/src/pkg/bufio/bufio.go:148
bufio.*Reader·ReadByte(0x7c97e0, 0x1, 0x127, 0x2)
websocket.*Conn·Read+0x4f /Users/makoto/go/src/pkg/websocket/websocket.go:56
websocket.*Conn·Read(0x7c97e0, 0x1, 0x0, 0x0, 0x1, ...)
io.Copy+0x1c7 /Users/makoto/go/src/pkg/io/io.go:254
io.Copy(0xd4a630, 0x8f7000, 0x8000, 0x8000, 0x0, ...)
main.echoServer+0x7b /Users/makoto/tmp/websocket2.go:14
main.echoServer(0x172d20, 0xd4a630)
websocket.Handler·ServeHTTP+0x968 /Users/makoto/go/src/pkg/websocket/server.go:165
websocket.Handler·ServeHTTP(0xd4a630, 0x11, 0x8138c0, 0x18)
http.*ServeMux·ServeHTTP+0x21c /Users/makoto/go/src/pkg/http/server.go:552
http.*ServeMux·ServeHTTP(0x1c00, 0x768700, 0x35d5b0, 0x5)
http.*Conn·serve+0x73 /Users/makoto/go/src/pkg/http/server.go:333
http.*Conn·serve(0xfe838, 0x768700)
goexit /Users/makoto/go/src/pkg/runtime/proc.c:145
goexit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment