|
If I created custom protocol that's a 'ISessionProtocol' I can use ILocalPeer.DialAsync() and it works But ILocalPeer.DialAsync fails if is ISessionProtocol<'req, 'res> The specialization is asymmetric protocol in nature and apparently it allows passing a request to DialAsync which's handy sometimes and I understand it's unmagical and can not serialize anything I requested to the remote machine and it's simply a request passed to the DialAsync method itself which I should implement in the protocol implementation if I want any serialization or something I should accomplish, and can use it still for yielding the request-response control flow out of the handler for protocol's DialAsync/ListenAsync, |
Replies: 1 comment 3 replies
|
Although I realized ILocalPeer.DialAsync is callable in both ILocalPeer.DialAsync and ILocalAsync.DialAsync(request) |
I figured out, the proper way for calling ISession.DialAsync(request) using Asymmetric protocol is ISession.DialAsync<ISessionProtocol<'req, 'res>, 'req, 'res>(request)
I would be hoping in the future ISession.DialAsync simply takes an optional parameter called request, since usually ILibp2pPeerFactoryBuilder has the protocol added and generates IPeerFactory which generates ILocalPeer which generates ISession. If needed I guess several solution can consolidate the experience :
A