Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
e9b424fc
Commit
e9b424fc
authored
Jul 06, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
92fe5a52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
go/neo/neonet/connection.go
go/neo/neonet/connection.go
+8
-6
No files found.
go/neo/neonet/connection.go
View file @
e9b424fc
...
...
@@ -983,13 +983,13 @@ func (link *NodeLink) replyNoConn(connId uint32, errMsg proto.Msg) {
// ---- transmit ----
// txReq is request to transmit a packet. Result error goes back to errch
// txReq is request to transmit a packet. Result error goes back to errch
.
type
txReq
struct
{
pkt
*
pktBuf
errch
chan
error
}
// errSendShutdown returns appropriate error when c.txdown is found ready in Send
// errSendShutdown returns appropriate error when c.txdown is found ready in Send
.
func
(
c
*
Conn
)
errSendShutdown
()
error
{
switch
{
case
c
.
txclosed
.
Get
()
!=
0
:
...
...
@@ -1074,6 +1074,8 @@ func (nl *NodeLink) serveSend() {
// FIXME if several goroutines call conn.Send
// simultaneously - c.txerr even if buffered(1) will be
// overflown and thus deadlock here.
//
// -> require "Conn.Send must not be used concurrently"?
txreq
.
errch
<-
err
// on IO error framing over peerLink becomes broken
...
...
@@ -1104,7 +1106,7 @@ func (c *Conn) sendPktDirect(pkt *pktBuf) error {
// set pkt connId associated with this connection
pkt
.
Header
()
.
ConnId
=
packed
.
Hton32
(
c
.
connId
)
//
XXX
if n.peerLink was just closed by rx->shutdown we'll get ErrNetClosing
//
NOTE
if n.peerLink was just closed by rx->shutdown we'll get ErrNetClosing
err
:=
c
.
link
.
sendPkt
(
pkt
)
//fmt.Printf("sendPkt -> %v\n", err)
...
...
@@ -1211,7 +1213,7 @@ func (nl *NodeLink) recvPkt() (*pktBuf, error) {
data
=
data
[
:
n
]
pkt
.
data
=
data
if
/* XXX temp show only tx */
true
&&
dumpio
{
if
dumpio
{
// XXX -> log
fmt
.
Printf
(
"%v < %v: %v
\n
"
,
nl
.
peerLink
.
LocalAddr
(),
nl
.
peerLink
.
RemoteAddr
(),
pkt
)
}
...
...
@@ -1343,7 +1345,7 @@ func (c *Conn) _Recv(pkt *pktBuf) (proto.Msg, error) {
// sendMsg sends message with specified connection ID.
//
// it encodes message int packet, sets header appropriately and sends it.
// it encodes message int
o
packet, sets header appropriately and sends it.
//
// it is ok to call sendMsg in parallel with serveSend. XXX link to sendPktDirect for rationale?
func
(
link
*
NodeLink
)
sendMsg
(
connId
uint32
,
msg
proto
.
Msg
)
error
{
...
...
@@ -1367,7 +1369,7 @@ func (c *Conn) sendMsgDirect(msg proto.Msg) error {
}
// Expect receives message and checks it is one of expected types
// Expect receives message and checks it is one of expected types
.
//
// If verification is successful the message is decoded inplace and returned
// which indicates index of received message.
...
...
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