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
0a27363b
Commit
0a27363b
authored
Aug 31, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0430db7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
go/neo/connection.go
go/neo/connection.go
+4
-2
go/neo/connection_test.go
go/neo/connection_test.go
+13
-3
No files found.
go/neo/connection.go
View file @
0a27363b
...
...
@@ -584,6 +584,8 @@ func (nl *NodeLink) serveRecv() {
accept
=
true
}
// XXX cleanup vvv ^^^
/*
// delete temporary conn from .connTab - this way the
// connection will be automatically garbage-collected
...
...
@@ -600,7 +602,7 @@ func (nl *NodeLink) serveRecv() {
conn
.
shutdownRX
(
errConnClosed
)
}
// don't even try
to `conn.rxq <- ...` if
.rxdown is ready
// don't even try
`conn.rxq <- ...` if conn
.rxdown is ready
// ( else since select is picking random ready variant Recv/serveRecv
// could receive something on rxdown Conn sometimes )
rxdown
:=
false
...
...
@@ -637,7 +639,7 @@ func (nl *NodeLink) serveRecv() {
if
accept
{
// don't even try
to `link.acceptq <- ...` if
.axdown is ready
// don't even try
`link.acceptq <- ...` if link
.axdown is ready
// ( else since select is picking random ready variant Accept/serveRecv
// could receive something on axdown Link sometimes )
axdown
:=
false
...
...
go/neo/connection_test.go
View file @
0a27363b
...
...
@@ -201,7 +201,7 @@ func TestNodeLink(t *testing.T) {
xwait
(
wg
)
xclose
(
nl2
)
//
Close
vs Accept
//
{Close,CloseAccept}
vs Accept
nl1
,
nl2
=
_nodeLinkPipe
(
linkNoRecvSend
,
linkNoRecvSend
)
wg
=
&
xsync
.
WorkGroup
{}
wg
.
Gox
(
func
()
{
...
...
@@ -214,13 +214,23 @@ func TestNodeLink(t *testing.T) {
t
.
Fatalf
(
"NodeLink.Accept() after close: conn = %v, err = %v"
,
c
,
err
)
}
println
(
"222 + 2"
)
// nl1 is not accepting connections - because it has LinkClient role
// check Accept behaviour.
wg
.
Gox
(
func
()
{
tdelay
()
nl1
.
CloseAccept
()
})
c
,
err
=
nl1
.
Accept
()
if
!
(
c
==
nil
&&
xlinkError
(
err
)
==
ErrLinkNoListen
)
{
t
.
Fatalf
(
"NodeLink.Accept() after CloseAccept: conn = %v, err = %v"
,
c
,
err
)
}
xwait
(
wg
)
// nl1 is now not accepting connections - because it was CloseAccept'ed
// check further Accept behaviour.
c
,
err
=
nl1
.
Accept
()
if
!
(
c
==
nil
&&
xlinkError
(
err
)
==
ErrLinkNoListen
)
{
t
.
Fatalf
(
"NodeLink.Accept() on non-listening node link: conn = %v, err = %v"
,
c
,
err
)
}
println
(
"222 + 3"
)
xclose
(
nl1
)
println
(
"333"
)
...
...
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