Commit Graph

10 Commits

Author SHA1 Message Date
Matt Joiner 12c77bc410 Fix race in TextPexConnState 2021-12-16 14:19:21 +11:00
YenForYang 29638d9e5d
Create default constructor for Client (#567)
Allow for certain values to always be properly initialized on construction -- namely the maps for now. I'm currently working on a change that requires a baseline constructor; this change would make the use of `chansync.BroadcastCond` and `chansync.SetOnce` obsolete -- i.e. one can have channel members without worrying about proper initialization/destruction of a `chan struct{}`.

As for why `makeClient` returns a value instead of a pointer: returning a value gives us more options -- you can always take a pointer from a value later on cheaply, and have things moved to the heap if they weren't already. The same can't be said about getting a value back from a pointer. GC also could potentially have less work to do. Plus I personally find ownership to be an important concept (semi-borrowed from rust) -- use of values make ownership clear.
2021-09-14 23:01:20 +10:00
Matt Joiner 36f52d7a14 Apply next request state asynchronously 2021-06-07 13:01:40 +10:00
Matt Joiner 24ceed61da Break out peerConnWriter 2021-06-07 13:01:40 +10:00
Matt Joiner 47284cf426 Rename Torrent.{add,delete}Connection 2021-05-14 15:39:01 +10:00
Matt Joiner 7f7c59d52e Replace internal/tmproot with Testing.TB.TempDir 2021-02-22 14:30:09 +11:00
Matt Joiner b5215ea7e8 Expose Peer.Network to replace Peer.RemoteAddr.Network 2021-01-25 15:49:48 +11:00
Matt Joiner c1d189ed31 Performance improvements to PEX 2020-10-23 08:58:55 +11:00
Matt Joiner 166f878bdc Fix change in Client.newConnection 2020-04-15 17:28:39 +10:00
Yaroslav Kolomiiets 2b2c480706 PEX: add periodic deltas 2020-04-15 17:24:44 +10:00