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
8e974dd9
Commit
8e974dd9
authored
Jan 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c8366907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
59 deletions
+0
-59
go/neo/xneo/nodetab.go
go/neo/xneo/nodetab.go
+0
-59
No files found.
go/neo/xneo/nodetab.go
View file @
8e974dd9
...
...
@@ -100,9 +100,6 @@ type Node struct {
// peer.linkMu and for some waiters chances are another .Link()
// already started redialing and they will have to wait again)
dialing
*
dialed
// // live connection pool that user provided back here via .PutConn()
// connPool []*Conn
}
// Len returns N(entries) in the table.
...
...
@@ -454,59 +451,3 @@ func (p *Node) Dial(ctx context.Context) (*neonet.NodeLink, error) {
<-
dialing
.
ready
return
dialing
.
link
,
dialing
.
err
}
// XXX unused - kill?
// Conn returns conn to the peer. XXX -> DialConn ?
//
// If there is no link established - conn first dials peer (see Dial).
//
// For established link Conn either creates new connection over the link,
// XXX (currently inactive) or gets one from the pool of unused connections (see PutConn).
func
(
p
*
Node
)
Conn
(
ctx
context
.
Context
)
(
*
neonet
.
Conn
,
error
)
{
var
err
error
/*
p.linkMu.Lock()
if l := len(p.connPool); l > 0 {
conn := p.connPool[l-1]
p.connPool = p.connPool[:l-1]
p.linkMu.Unlock()
return conn, nil
}
*/
// connection poll is empty - let's create new connection from .link
link
:=
p
.
link
p
.
linkMu
.
Unlock
()
// we might need to (re)dial
if
link
==
nil
{
link
,
err
=
p
.
Dial
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
}
return
link
.
NewConn
()
}
/*
// PutConn saves c in the pool of unused connections.
//
// Since connections saved into pool can be reused by other code, after
// PutConn call the caller must not use the connection directly.
//
// PutConn ignores connections not created for current peer link.
func (p *Peer) PutConn(c *Conn) {
p.linkMu.Lock()
// NOTE we can't panic on p.link != c.Dial() - reason is: p.link can change on redial
if p.link == c.Dial() {
p.connPool = append(p.connPool, c)
}
p.linkMu.Unlock()
}
*/
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