Hi there,
With app proxy, when in case flow read, tcp connection read or udp session read empty is encountered.
In this case, should I return directly, or close flow, connection, session and then return, or should I go on write through the empty data as usual even if it is empty?
Put below the code example in case of flow read and connection write.
flow.readData { data, readError in
guard readError == nil, let readData = data else {
log.error("[LogApp] Failed to read data from the TCP flow \(self.local.debugDescription)")
local.closeWriteWithError(readError)
local.closeReadWithError(readError)
return
}
guard !readData.isEmpty else {
log.verbose("[LogApp] Empty data from TCP flow \(self.local.description)")
// What should I do here?
// return directly
// or close flow and return
// or keep on going to connection write?
}
connection.send(content: data, completion: .contentProcessed( { connectionError in
...
}))
Thanks in advance for any suggestion.