-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net-io #443
net-io #443
Conversation
msg, err := c.ReadMsg() | ||
if err != nil { | ||
log.Infof("%s connection failed: %s", c, err) | ||
close(ch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want ch
closed upon Done/Closing? Is this actor the sole ch
sender?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it is the only actor. you're right, this needs to be defer
ed.
note that this is a hideous thing that should go away before this PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in fac3fdb
may want to use |
Ah, indeed. habit. :/ |
squashed these as they were inter-dependent commits. |
conn.msgio.incoming.ReadFromWithPool(maconn, &mpool.ByteSlicePool) | ||
conn.Children().Done() | ||
}() | ||
log.Debugf("newSingleConn %p: %v to %v", conn, local, remote) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how much cleaner this all looks. RWIO is elegant.
@jbenet i'm curious to learn what you've got in mind for the interfaces that touch bitswap and the dht. i know that sometimes these things don't come into focus until you've waded through the lower-level bits for a while. is it still too early to know? The last time around, there was some friction around service construction/client registration as well as contracts between sender and receiver. This time around, constraints/client needs around back-pressure and service guarantees have come to the forefront. We may benefit from some interface coordination. |
This commit changes the connections to use io.ReadWriters instead of channels (+ async workers). This is a pretty big change -- away from csp -- in the name of performance (and predictable flow control). It also uses the brand new secio, which is spipe's successor.
- removed ctxcloser - removed multiconn - focused on netio
omg wow such pass
container/lists suck
@maybebtc thoughts on this? dialing self should be **possible**, so we should in general test that we do consider that case, but not sure if this is good to expose to clients. thoughts? Btw, on why dialing self should be possible, we may create little protocols which we may have a node connect to self, say across its interfaces to test connectivity, etc... think of it like: > server localhost:1234 & > curl localhost:1234
Found bugs with it :)
Sadly, as cool as this test is, it doesn't work Because spdystream doesnt handle stream open backpressure well. I'll see about rewriting that part when it becomes a problem. More backpressure tests comming.
…-doc Remove incorrect doc
(after #442)
This PR changes net to use
io
instead of channels.At the moment it's just
conn
, but soon more.