2
0
mirror of https://github.com/soheilhy/cmux.git synced 2024-09-20 02:55:46 +08:00
Commit Graph

8 Commits

Author SHA1 Message Date
Tamir Duberstein
48deeb47a3 golint
cmux.go:28:1: exported method ErrNotMatched.Temporary should have comment or be unexported
cmux.go:29:1: exported method ErrNotMatched.Timeout should have comment or be unexported
cmux.go:38:2: exported var ErrListenerClosed should have comment or be unexported
cmux.go:165:6: exported type MuxConn should have comment or be unexported
2016-02-21 10:34:32 -05:00
Ethan Mosbaugh
4ebe86a5a2 rely on project to call flag.Parse rather than when used as library 2016-02-09 07:53:32 -08:00
Tamir Duberstein
563c371a98 Cleanup code in cmux and bench_test.
This commit is a partial cherry pick of pull request #3, for code cleanup.
2015-12-19 22:37:27 -05:00
Soheil Hassas Yeganeh
89dd8ce1fd Return an error in Accept() when root is closed.
As reported in #4, when the root listener is closed, calling Accept
on mux'd listeners would block forever, instead of returning an error.
This is because of a bug introduced in b90740d.

This commit fixes #4 by selecting on both donec and connc of muxed
listeners.

Added a test case to guard against this issue.
2015-12-19 22:28:37 -05:00
Soheil Hassas Yeganeh
b90740dfa9 Fix send on closed channel
If a matcher go-routine mateches a connection after the root
listener was closed, cmux will panic since all connection channels
will be closed. This commit avoids closing connection channels but
signals the matcher go-routines that the listener is closed via
a done channel.

Tested: Added a test case for this issue.
2015-08-30 21:10:18 -04:00
Soheil Hassas Yeganeh
fbd0877935 Use a custom buffer intead of buffers from bytes
This commit implements a new buffer that eliminates a few copies.
2015-08-01 11:59:50 -04:00
Soheil Hassas Yeganeh
581432eab8 Mux connections in parallel
This commit launches a go-routine for each accepted connection, to match
them in parallel.
2015-07-31 19:42:28 -04:00
Soheil Hassas Yeganeh
754f5b897d Initial commit 2015-07-29 13:49:26 -04:00