Skip to content

Commit

Permalink
bump yamux backlog setting way up
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Mar 9, 2016
1 parent 955ae93 commit ec85e0b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion p2p/net/swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func init() {
msstpt := psmss.NewBlankTransport()

ymxtpt := &yamux.Transport{
AcceptBacklog: 2048,
AcceptBacklog: 8192,
ConnectionWriteTimeout: time.Second * 10,
KeepAliveInterval: time.Second * 30,
EnableKeepAlive: true,
Expand Down
5 changes: 3 additions & 2 deletions p2p/net/swarm/swarm_listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
ps "gx/ipfs/QmZK81vcgMhpb2t7GNbozk7qzt6Rj4zFqitpvsWT9mduW8/go-peerstream"
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
ma "gx/ipfs/QmcobAGsCjYt5DXoq9et9L8yR8er7o7Cu3DTvpaq12jYSz/go-multiaddr"
) // Open listeners and reuse-dialers for the given addresses
)

// Open listeners and reuse-dialers for the given addresses
func (s *Swarm) setupInterfaces(addrs []ma.Multiaddr) error {
errs := make([]error, len(addrs))
var succeeded int
Expand Down Expand Up @@ -152,7 +153,7 @@ func (s *Swarm) connHandler(c *ps.Conn) *Conn {
if err != nil {
log.Debug(err)
log.Event(ctx, "newConnHandlerDisconnect", lgbl.NetConn(c.NetConn()), lgbl.Error(err))
c.Close() // boom. close it.
c.Close() // boom. close it.
return nil
}

Expand Down
24 changes: 12 additions & 12 deletions p2p/test/reconnects/reconnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ func EchoStreamHandler(stream inet.Stream) {
}

type sendChans struct {
send chan struct{}
sent chan struct{}
read chan struct{}
close_ chan struct{}
closed chan struct{}
send chan struct{}
sent chan struct{}
read chan struct{}
close_ chan struct{}
closed chan struct{}
}

func newSendChans() sendChans {
return sendChans{
send: make(chan struct{}),
sent: make(chan struct{}),
read: make(chan struct{}),
close_: make(chan struct{}),
closed: make(chan struct{}),
send: make(chan struct{}),
sent: make(chan struct{}),
read: make(chan struct{}),
close_: make(chan struct{}),
closed: make(chan struct{}),
}
}

Expand Down Expand Up @@ -188,7 +188,7 @@ func SubtestConnSendDisc(t *testing.T, hosts []host.Host) {

go sF(s)
log.Debugf("getting handle %d", j)
sc := <-ss // wait to get handle.
sc := <-ss // wait to get handle.
log.Debugf("spawning worker %d", j)

for k := 0; k < numMsgs; k++ {
Expand All @@ -215,7 +215,7 @@ func SubtestConnSendDisc(t *testing.T, hosts []host.Host) {
for _, c := range cs {
sc := c.(*swarm.Conn)
if sc.LocalPeer() > sc.RemotePeer() {
continue // only close it on one side.
continue // only close it on one side.
}

log.Debugf("closing: %s", sc.RawConn())
Expand Down

0 comments on commit ec85e0b

Please sign in to comment.