Commit Graph

202 Commits

Author SHA1 Message Date
Juan Batiz-Benet
e5e2d59f0e moved mux into net 2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
31a3c4497a swarm fixes 2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
b5b4390ca4 refactor SwarmConn -> Conn 2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
9c11970554 handler muxer 2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
6bc26f1752 writing swarm2 using go-peerstream
omg wow such pass
2014-12-16 05:10:46 -08:00
Juan Batiz-Benet
a3a48ce67b conn: tests pass :) 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
0061f0c151 new swarm -- it's so simple 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
393842e245 much simpler net
- removed ctxcloser
- removed multiconn
- focused on netio
2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
9b7fb704ef make net/conn.Conn conform to net.Conn 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
3b29653022 updated msgio + secio 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
9d304768fc stash 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
bd636e1e95 muxer io 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
d94593a955 new swarm with io and router 2014-12-16 05:10:44 -08:00
Juan Batiz-Benet
129eca0d82 multiconn: close fanIn + error 2014-12-16 05:10:44 -08:00
Juan Batiz-Benet
5341379f9d net/conn: io, not channels
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.
2014-12-16 05:10:44 -08:00
Brian Tiger Chow
c2c95d1105 start threading context through the system
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-09 07:11:48 -08:00
Juan Batiz-Benet
dc9f1c4532 net: README.
I'm using a Google Drawing to make this diagram.
Turned out pretty well.
2014-12-09 02:12:43 -08:00
Juan Batiz-Benet
93872a52fc net/interface: use iota 2014-12-08 21:12:58 -08:00
Juan Batiz-Benet
f15ab8eec3 net: add LocalPeer funcs 2014-12-08 20:52:45 -08:00
Juan Batiz-Benet
ff1e672d5a dht/pb: changed PeersToPBPeers to set ConnectionType
Uses an inet.Dialer
2014-12-08 20:52:45 -08:00
Juan Batiz-Benet
94f04c7fcc net: add Connectedness var. 2014-12-08 20:52:45 -08:00
Brian Tiger Chow
93fb9fb929 style(logging) demote some statements to Debug (from info)
to improve SnR. Feel free to contest these changes if you find these
statements useful. In my experience, they were adding noise at Info.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
5313c1ae22 fix(swarm) Dial panic
+/- if len(addresses) is 0, connSetup will be called with nil value for c.
+/- avoid variable reassignment

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
c67286774c silence verbose output
for higher SnR at IPFS_LOGGING=info

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
f25893e31a style(net) rm unused error
having an error return value makes the interface a bit confusing to
use. Just ponder... What would an error returned from a predicate
function mean?

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
74eb03231d fix(core, peer) helpers to testutil, err handling
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 14:32:52 -08:00
Brian Tiger Chow
d77c4bb5e0 refactor(peer): create peer through peerstore
for safety!

use mockpeer.WithID methods to create peers in tests

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
73a89e161d refactor(peerstore) s/Get/FindOrCreate
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Juan Batiz-Benet
59c1ab2fc3 Merge pull request #406 from jbenet/new-msgio
updated msgio
2014-12-06 16:20:51 -08:00
Juan Batiz-Benet
a522a5a532 conn: larger max message.
With the new msgio, we no longer need to bound message sizes for
the sake of buffers. MaxMessageSize should remain though in order
to prevent streaming of huge things. In general, messages shouldn't
be above one MB. This max is now set to 4MB.

If a block happens to be larger, we should split it up.
2014-12-06 11:29:31 -05:00
Juan Batiz-Benet
97e0f73e79 msgio: updated to remove max size 2014-12-06 11:26:47 -05:00
Brian Tiger Chow
f870948274 fix: multiconn s/Conns()/getConns()
@jbenet

must be getConns to avoid clash with private var

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:28 -08:00
Brian Tiger Chow
1026244f13 fix(net/mux) rate-limit producers by handling outgoing message synchronously
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:27 -08:00
Brian Tiger Chow
229c93f72f fix(net/multiconn) data race in test
https://build.protocol-dev.com/job/go-ipfs.test.go.race.nofuse/276/console

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:26 -08:00
Jeromy
ed4509923c tracking down a bug dhthell found, added asserts and better logging. 2014-12-05 20:53:26 +00:00
Jeromy
0abc72c062 move some variables into strategy 2014-12-05 20:53:21 +00:00
Brian Tiger Chow
0fc95d5add log(swarm, netmessage) Event: connSetup(begin|success)
+ netmessage is now loggable

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:40 -08:00
Jeromy
34da5f039c log formatting (info -> infof) 2014-11-21 03:54:26 +00:00
Brian Tiger Chow
93cf2bb176 style(net/conn) fmt -> debugerror
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-20 16:14:23 -08:00
Juan Batiz-Benet
f99117bcd2 swarm: try all peer's addresses
For simplicity this is sequential. This will be bad latency given
RTTs for all the handshakes, etc. Later on can make async or
at least open based on some priority of the channel.
2014-11-20 09:14:49 -08:00
Juan Batiz-Benet
48879dd56c conn: added (*dialer).DialAddr 2014-11-20 09:14:49 -08:00
Juan Batiz-Benet
c7fd1d9ddb swarm: refactored multiconn creation 2014-11-20 09:14:49 -08:00
Juan Batiz-Benet
e0dab75d54 swarm: better err on listen fail 2014-11-20 09:14:48 -08:00
Juan Batiz-Benet
fc6bab7b73 net/conn: moved zero addr error 2014-11-20 01:27:18 -08:00
Juan Batiz-Benet
43452fdeb7 updated multiaddr + multiaddr-net
I broke out multiaddr/net to its own package so
that multiaddr parsing could remain lean. multiaddr-net
will vendor special implementations of protocols (like utp)
2014-11-20 00:58:48 -08:00
Juan Batiz-Benet
faab984278 net: expose GetConnections 2014-11-18 00:47:42 -08:00
Jeromy
0de12b5d36 implement ipfs id in the new commands library 2014-11-16 16:46:06 -08:00
Brian Tiger Chow
6291c25455 fix(net/conn) Set peer to "Remote" in Dial method
@jbenet we may want to consider setting the default type to Remote. I
left the default as Unspecified just for safety.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:01 -08:00
Brian Tiger Chow
6fec76d93e fix(imports) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
25c98e8e61 refactor(eventlog) elog -> eventlog
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00