mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-11 19:44:18 +00:00
add proper pragmas
This commit is contained in:
parent
5177bbb492
commit
d63e0c003b
@ -80,7 +80,7 @@ proc decodeMsg*(buf: seq[byte]): IdentifyInfo =
|
|||||||
discard pb.getString(6, result.agentVersion)
|
discard pb.getString(6, result.agentVersion)
|
||||||
|
|
||||||
method init*(p: Identify) =
|
method init*(p: Identify) =
|
||||||
proc handle(conn: Connection, proto: string) {.async, gcsafe.} =
|
proc handle(conn: Connection, proto: string) {.async, gcsafe, closure.} =
|
||||||
var pb = encodeMsg(p.peerInfo, await conn.getObservedAddrs())
|
var pb = encodeMsg(p.peerInfo, await conn.getObservedAddrs())
|
||||||
await conn.writeLp(pb.buffer)
|
await conn.writeLp(pb.buffer)
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ import connection, transport,
|
|||||||
type
|
type
|
||||||
LPProtoHandler* = proc (conn: Connection,
|
LPProtoHandler* = proc (conn: Connection,
|
||||||
proto: string):
|
proto: string):
|
||||||
Future[void] {.gcsafe.}
|
Future[void] {.gcsafe, closure.}
|
||||||
|
|
||||||
LPProtocol* = ref object of RootObj
|
LPProtocol* = ref object of RootObj
|
||||||
peerInfo*: PeerInfo
|
peerInfo*: PeerInfo
|
||||||
codec*: string
|
codec*: string
|
||||||
handler*: LPProtoHandler
|
handler*: LPProtoHandler ## this handler gets invoked by the protocol negotiator
|
||||||
|
|
||||||
proc newProtocol*(p: typedesc[LPProtocol],
|
proc newProtocol*(p: typedesc[LPProtocol],
|
||||||
peerInfo: PeerInfo): p =
|
peerInfo: PeerInfo): p =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user