Skip to content
This repository was archived by the owner on Aug 18, 2026. It is now read-only.
This repository was archived by the owner on Aug 18, 2026. It is now read-only.

Golang Demo: panic: close of closed channel #17

Description

@mattatcha

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions