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-unixfs
Commits
25d0ce8f
Commit
25d0ce8f
authored
Sep 18, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NoResponse service
parent
69b1ce42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
net/service/service.go
net/service/service.go
+9
-0
No files found.
net/service/service.go
View file @
25d0ce8f
...
...
@@ -10,6 +10,10 @@ import (
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
)
// ErrNoResponse is returned by Service when a Request did not get a response,
// and no other error happened
var
ErrNoResponse
=
errors
.
New
(
"no response to request"
)
// Handler is an interface that objects must implement in order to handle
// a service's requests.
type
Handler
interface
{
...
...
@@ -134,6 +138,10 @@ func (s *Service) SendRequest(ctx context.Context, m msg.NetMessage) (msg.NetMes
err
=
ctx
.
Err
()
}
if
m
==
nil
{
return
nil
,
ErrNoResponse
}
return
m
,
err
}
...
...
@@ -205,6 +213,7 @@ func (s *Service) handleIncomingMessage(ctx context.Context, m msg.NetMessage) {
}
}
// SetHandler assigns the request Handler for this service.
func
(
s
*
Service
)
SetHandler
(
h
Handler
)
{
s
.
Handler
=
h
}
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