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
p2p
go-p2p-core
Commits
8721a124
Commit
8721a124
authored
Feb 29, 2020
by
Aarsh Shah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peer connectedness event
parent
f4b25da8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
event/network.go
event/network.go
+7
-12
No files found.
event/network.go
View file @
8721a124
...
...
@@ -2,18 +2,13 @@ package event
import
"github.com/libp2p/go-libp2p-core/network"
// EvtPeerConnectionStateChange should be emitted when we connect to a peer or disconnect
// from a peer. It contains the network interface for the connection,
// the connection handle & the new state of the connection.
type
EvtPeerConnectionStateChange
struct
{
// EvtPeerStateChange should be emitted when we form our first connection with a peer or drop our last
// connection with the peer. Essentially, it is emitted in two cases:
// a) We go from having no connection with a peer to having a connection with a peer.
// b) We go from having a connection/s with a peer to having no connection with the peer.
// It contains the network interface for the connection, the connection handle for the first/last connection and
// the new connection state.
type
EvtPeerStateChange
struct
{
Connection
network
.
Conn
NewState
network
.
Connectedness
}
// EvtStreamStateChange should be emitted when we open a new stream with a peer or close an existing stream.
// It contains the network interface for the connection, the stream handle &
// the new state of the stream.
type
EvtStreamStateChange
struct
{
Stream
network
.
Stream
NewState
network
.
Connectedness
}
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