mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-01-05 06:53:07 +00:00
try to add global registry of endpoints
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
e8b019b591
commit
2eef69f3e7
@ -29,6 +29,8 @@ type
|
||||
udata*: pointer # User-driven pointer
|
||||
local: TransportAddress # Local address
|
||||
|
||||
var network = initTable[TransportAddress, DatagramTransport]()
|
||||
|
||||
proc sendTo*[T](transp: DatagramTransport, remote: TransportAddress,
|
||||
msg: sink seq[T], msglen = -1) {.async.} =
|
||||
echo "sending to ", remote
|
||||
@ -60,6 +62,7 @@ proc newFakeDatagramTransport*[T](cbproc: DatagramCallback,
|
||||
GC_ref(udata)
|
||||
result.udata = cast[pointer](udata)
|
||||
result.local = local
|
||||
network[local] = result
|
||||
|
||||
|
||||
type
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user