Commit Graph

24 Commits

Author SHA1 Message Date
Marten Seemann
13e0150958
remove OpenedStream and ClosedStream from Notifiee interface (#250)
* remove TODO for PeerConnected and PeerDisconnected from Notifiee

This is now done via the event bus.

* remove OpenedStream and ClosedStream from Notifiee
2022-05-24 04:48:47 -07:00
vyzo
e4c76cf7cd
Network Resource Manager interface (#229)
* add resource manager interfaces

* add scope accessors to streams and conns

* add ResourceManager accessor to the Network interface

* allow initially unattached streams.

* introduce service scopes, canonicalize ownership interface through setters

* make system scope explicit

* make memory stat an int64

* make the system scope a generic resource scope, introduce the DMZ

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rename DMZ to transient scope, remove OpenConnection from PeerScope

* remove ncopy param from GrowBuffer

* remove protocols from OpenStream

The stream is unnegotiated state until the actual protocol has been determined.

* document nil receiver contract, fix protocol scope protocol accessor method

* remove nil receiver contract requirement

* flesh out stat struct

* turn resource manager scope accessors into viewers

* interface refiniments

1. Introduce transactions in all scopes
2. Limit the view of stream/connection scope for users, to avoid the Done footgun
3. Move OpenStream to the resource manager

* add Buffer interface

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* fix typo

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rename user scopes to plain names, management scopes as such

* rename BeginTxn to BeginTransaction

* RIP Buffers

* make ErrResourceLimitExceeded a temporary error; move rcmgr errors with the other errors.

* unexport TemporaryError

* null resource manager stub

* unexport the null stubs, make entry point a variable

* don't rely on typed nils but instead use actual null object instances

So that we don't confuse the hell out of everyone!

* add Scope to the CapableConn interface

* rename ConnectionScope to ConnScope for consistency

* fix typo

* rename ConnectionManagementScope to ConnManagementScope

* add the ConnManagementScope to Upgrader.Upgrade

* fix argument name

* godocs for ResourceManager

* introduce MemoryStatus indicator in ReserveMemory

* use uint8 for MemoryStatus

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* rework reservation interface to pass priority instead of returning memory status

so that we don't have to undo reservations if there is too much pressure.

* improve comment

* fix typo

* export the NullScope

* Stream.SetProtocol can return an error

It needs to attach the protocol to the protocol scope, which may fail.

* merge the mux package into network

* pass the PeerScope to Multiplexer.NetConn

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: raulk <raul@protocol.ai>

* Update network/rcmgr.go

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>

* remove reference to deprecated mux.MuxedConn

* rename transaction to span

* indicate bytes in ReserveMemory

* break ResourceManager View methods into Viewer interface.

* add experimental interface warning

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: raulk <raul@protocol.ai>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-01-16 23:15:05 -08:00
star
a61ab2c0f1
remove duplicate io.Closer on Network interface (#228) 2021-12-16 05:21:31 -08:00
Marten Seemann
ed7a5ab432
rename network.Stat to Stats, introduce ConnStats (#226) 2021-12-12 02:58:02 -08:00
Marten Seemann
1092414cf9
remove the ConnHandler (#214) 2021-10-18 05:34:50 -07:00
Marten Seemann
5f1ff676b2
remove the Process from the Network interface (#212) 2021-09-08 03:34:53 -07:00
Marten Seemann
094b0d3f8b
save the role (client, server) in the simultaneous connect context (#210) 2021-08-24 13:30:29 +01:00
vyzo
ca38e17432 mind the dot.
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
2021-02-19 12:32:44 +02:00
vyzo
29aaf384cf context option for simultaneous connect 2021-02-19 12:32:44 +02:00
Aarsh Shah
412dbb3544
Event for user's NAT Device Type: Tell user if the node is behind an Easy or Hard NAT (#173)
* event for NAT device type


Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-02-18 14:17:27 +05:30
vyzo
faf23c3b17 address aarshian nitpicks 2021-02-17 11:25:32 +02:00
vyzo
980a554aa5 make UseTransient context option take a reason argument, for consistency with other options 2021-02-17 11:25:32 +02:00
vyzo
a21b06e646 abstract Conn Stat interface for threading 2021-02-17 11:25:32 +02:00
vyzo
ac2ecf385a Update network/context.go
Co-authored-by: Yusef Napora <yusef@protocol.ai>
2021-02-17 11:25:32 +02:00
vyzo
8e949a777f add ErrTransientConn error 2021-02-17 11:25:32 +02:00
vyzo
7eee7c00a6 add support for transient connections 2021-02-17 11:25:32 +02:00
Aarsh Shah
6cea734154
context to force direct dial (#181) 2021-02-15 13:20:04 +05:30
Marten Seemann
83ac1d370d
add a context to OpenStream and NewStream (#172)
* add a context to MuxedConn.OpenStream

* add a context to Conn.NewStream
2020-12-19 09:36:59 +07:00
Raúl Kripalani
21efed7519
experimental introspection support (#159)
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-06-05 12:24:56 +01:00
Raúl Kripalani
9d35da1374
implement Stringer for network.{Direction,Connectedness,Reachability}. (#150) 2020-05-14 17:16:17 +01:00
Steven Allen
4cb536b589 fix: use correct reachability type 2020-04-13 10:42:57 -07:00
Steven Allen
e5f43bb541 rename routability -> reachability 2020-03-04 12:43:11 -08:00
Steven Allen
8157087fc9 feat: switch to a single routability event
This means we can make the event _stateful_ so subscribing always gives us the
last state.
2020-03-04 11:35:48 -08:00
Raúl Kripalani
6e566d10f4
Absorb go-libp2p abstractions and core types into this module (#1) 2019-05-22 18:31:11 +01:00