progrium/duplex

Golang Demo: panic: close of closed channel

mattatcha opened this issue · 1 comments

Running peer.call("doMsgbox", "Client called doMsgbox() on server, server called msgbox() on client.") works fine but peer.call("echo", {foo: "bar"}) causes go server to crash.

$ cd demo && go run demo.go
WS on 8001...
HTTP on 8000...
panic: close of closed channel

goroutine 9 [running]:
panic(0x2c3be0, 0xc860208070)
    /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/progrium/duplex/golang.(*Channel).Send(0xc8200f0060, 0x2c2e60, 0xc8201a40f0, 0x0, 0x0, 0x0)
    /Users/matt/src/github.com/progrium/duplex/golang/duplex.go:341 +0x241
main.init.1.func1(0xc8200f0060, 0x0, 0x0)
    /Users/matt/src/github.com/progrium/duplex/golang/demo/demo.go:20 +0xba
created by github.com/progrium/duplex/golang.(*Peer).route
    /Users/matt/src/github.com/progrium/duplex/golang/duplex.go:222 +0x67e
exit status 2
make: *** [demo] Error 1

Didn't we resolve this?