mirror of https://github.com/vacp2p/nim-libp2p.git
misc: nimpretty
This commit is contained in:
parent
3c2009c85e
commit
663ce6c589
|
@ -57,7 +57,7 @@ proc encodeSubs(subs: SubOpts, buff: var ProtoBuffer) {.gcsafe.} =
|
||||||
buff.write(initProtoField(2, subs.topic))
|
buff.write(initProtoField(2, subs.topic))
|
||||||
|
|
||||||
proc encodeRpcMsg*(msg: RPCMsg): ProtoBuffer {.gcsafe.} =
|
proc encodeRpcMsg*(msg: RPCMsg): ProtoBuffer {.gcsafe.} =
|
||||||
result = initProtoBuffer({WithVarintLength})
|
result = initProtoBuffer({WithVarintLength})
|
||||||
trace "encoding msg: ", msg = msg
|
trace "encoding msg: ", msg = msg
|
||||||
|
|
||||||
if msg.subscriptions.len > 0:
|
if msg.subscriptions.len > 0:
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
|
|
||||||
import sequtils
|
import sequtils
|
||||||
import chronos
|
import chronos
|
||||||
import ../peerinfo, ../connection,
|
import ../peerinfo,
|
||||||
../multiaddress, ../multicodec
|
../connection,
|
||||||
|
../multiaddress,
|
||||||
|
../multicodec
|
||||||
|
|
||||||
type
|
type
|
||||||
ConnHandler* = proc (conn: Connection): Future[void] {.gcsafe.}
|
ConnHandler* = proc (conn: Connection): Future[void] {.gcsafe.}
|
||||||
|
@ -40,19 +42,19 @@ method close*(t: Transport) {.base, async, gcsafe.} =
|
||||||
|
|
||||||
method listen*(t: Transport,
|
method listen*(t: Transport,
|
||||||
ma: MultiAddress,
|
ma: MultiAddress,
|
||||||
handler: ConnHandler):
|
handler: ConnHandler):
|
||||||
Future[Future[void]] {.base, async, gcsafe.} =
|
Future[Future[void]] {.base, async, gcsafe.} =
|
||||||
## listen for incoming connections
|
## listen for incoming connections
|
||||||
t.ma = ma
|
t.ma = ma
|
||||||
t.handler = handler
|
t.handler = handler
|
||||||
|
|
||||||
method dial*(t: Transport,
|
method dial*(t: Transport,
|
||||||
address: MultiAddress):
|
address: MultiAddress):
|
||||||
Future[Connection] {.base, async, gcsafe.} =
|
Future[Connection] {.base, async, gcsafe.} =
|
||||||
## dial a peer
|
## dial a peer
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method upgrade*(t: Transport) {.base, async, gcsafe.} =
|
method upgrade*(t: Transport) {.base, async, gcsafe.} =
|
||||||
## base upgrade method that the transport uses to perform
|
## base upgrade method that the transport uses to perform
|
||||||
## transport specific upgrades
|
## transport specific upgrades
|
||||||
discard
|
discard
|
||||||
|
|
Loading…
Reference in New Issue