Skip to content
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

Merged
merged 58 commits into from
Dec 18, 2014
Merged

net-io #443

merged 58 commits into from
Dec 18, 2014

Conversation

jbenet
Copy link
Member

@jbenet jbenet commented Dec 12, 2014

(after #442)

This PR changes net to use io instead of channels.
At the moment it's just conn, but soon more.

@jbenet jbenet added the status/in-progress In progress label Dec 12, 2014
msg, err := c.ReadMsg()
if err != nil {
log.Infof("%s connection failed: %s", c, err)
close(ch)
Copy link
Contributor

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?

Copy link
Member Author

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 defered.
note that this is a hideous thing that should go away before this PR is merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fac3fdb

@btc
Copy link
Contributor

btc commented Dec 12, 2014

may want to use debugerror as a dropin (or named) replacement for errors.New and fmt.Errorf. It provides helpful stack traces in debug mode. Easier to figure out where errors originate.

@jbenet
Copy link
Member Author

jbenet commented Dec 12, 2014

may want to use debugerror

Ah, indeed. habit. :/

@jbenet
Copy link
Member Author

jbenet commented Dec 12, 2014

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)

Copy link
Member

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.

@btc
Copy link
Contributor

btc commented Dec 13, 2014

@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.

Brian Tiger Chow and others added 24 commits December 17, 2014 23:25
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.
jbenet added a commit that referenced this pull request Dec 18, 2014
@jbenet jbenet merged commit 911b54e into master Dec 18, 2014
@jbenet jbenet removed the status/in-progress In progress label Dec 18, 2014
@btc btc deleted the ionet-conn branch January 21, 2015 01:02
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this pull request Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants