Post

Replies

Boosts

Views

Activity

how to get framer transport properties
I'm implementing custom protocol using NWListener and NWProtocolFramerImplementation with transport options using let parameters = NWParameters(dtls: nil, udp: NWProtocolUDP.Options()) parameters.defaultProtocolStack.applicationProtocols = [NWProtocolFramer.Options(definition: CustomProtocol.definition)] let listener = try NWListener(using: parameters, on: port) same for TCP with appropriate options. how should we can get transport options(UDP|TCP) from framer when receiving data in parseInput ? Because implementations for TCP and UDP can be different. I am not touching protocol stacking intentionally as this is whole another topic.
1
0
585
Mar ’21
isComplete is not set by upstream protocol in the stack
I believe this could by a bug in network.framework. So i've set up simple UDP syslog server using NWListener: parameters.defaultProtocolStack.applicationProtocols = [NWProtocolFramer.Options(definition: SyslogProtocol.definition)] and it works as intended reveiving every UDP message with isComplete flag true in handleInput when framer.parseInput is called. But if i prepend additional protocol parameters.defaultProtocolStack.applicationProtocols.insert(NWProtocolFramer.Options(definition: ValueLengthProtocol.definition), at: 0) to the protocol stack which simply forwards the message to downstream protocol without any data manipulation framer.deliverInputNoCopy(length: length, message: message, isComplete: true)  the downstream protocol receives isComplete false. So the question is this a bug or what should be done to preserve isComplete flag ?
3
0
610
Mar ’21