mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-01-11 01:06:23 +00:00
ccd019b328
* use stream directly in chronosstream for now, chronos.AsyncStream is not used to provide any features on top of chronos.Stream, so in order to simplify the code, chronosstream can be used directly. In particular, the exception handling is broken in the current chronosstream - opening and closing the stream is simplified this way as well. A future implementation that actually takes advantage of the AsyncStream features would wrap AsyncStream instead as a separate lpstream implementation, leaving this one as-is. * work around chronos exception type issue
24 lines
574 B
Nim
24 lines
574 B
Nim
import chronos
|
|
|
|
import ../libp2p/transports/tcptransport
|
|
import ../libp2p/stream/bufferstream
|
|
|
|
const
|
|
StreamTransportTrackerName = "stream.transport"
|
|
StreamServerTrackerName = "stream.server"
|
|
|
|
trackerNames = [
|
|
BufferStreamTrackerName,
|
|
TcpTransportTrackerName,
|
|
StreamTransportTrackerName,
|
|
StreamServerTrackerName
|
|
]
|
|
|
|
iterator testTrackers*(extras: openArray[string] = []): TrackerBase =
|
|
for name in trackerNames:
|
|
let t = getTracker(name)
|
|
if not isNil(t): yield t
|
|
for name in extras:
|
|
let t = getTracker(name)
|
|
if not isNil(t): yield t
|