I need to provide information from my application to my network protocol framer to be used during the handshake but cannot find a way to do this. I'm not sending any message yet so cannot use NWProtocolFramer.Message
. Is there any way to do this?
I'm also looking for a way to provide information obtained during the handshake back to the application, ideally I would be able to attach such information to the connection itself so it can be retrieved later by the application. Only way I can think of for now is calling framer.deliverInput()
during the handshake to deliver a fake message but that doesn't sound great. Is there a better way?
I would love if there was some sort of storage attached to the connection itself that could be used to exchange information between the application and the protocol framer.
If we could pass some context intoActually it wouldn't solve my problem, for the listener the options are inserted into NWListener and not NWConnection. Rather I need access to the connection itself from my protocol framer, or to storage/context associated with the connection.NWProtocolFramer.Options
and access it from the protocol framer, that would also solve my problem.How do people solve that problem? It seems to me this is a pretty basic need but it is seemingly impossible to do, am I missing something here?