Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
69b1ce42
Commit
69b1ce42
authored
10 years ago
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nil muxer
parent
dc0fbfd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
net/mux/mux.go
net/mux/mux.go
+9
-0
No files found.
net/mux/mux.go
View file @
69b1ce42
...
...
@@ -41,6 +41,10 @@ func (m *Muxer) GetPipe() *msg.Pipe {
// Start kicks off the Muxer goroutines.
func
(
m
*
Muxer
)
Start
(
ctx
context
.
Context
)
error
{
if
m
==
nil
{
panic
(
"nix muxer"
)
}
if
m
.
cancel
!=
nil
{
return
errors
.
New
(
"Muxer already started."
)
}
...
...
@@ -75,7 +79,12 @@ func (m *Muxer) AddProtocol(p Protocol, pid ProtocolID) error {
// handleIncoming consumes the messages on the m.Incoming channel and
// routes them appropriately (to the protocols).
func
(
m
*
Muxer
)
handleIncomingMessages
(
ctx
context
.
Context
)
{
for
{
if
m
==
nil
{
panic
(
"nix muxer"
)
}
select
{
case
msg
:=
<-
m
.
Incoming
:
go
m
.
handleIncomingMessage
(
ctx
,
msg
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment