Network is not working when over 50MB size file upload smb using NEFilterDataProvider in macOS
The event received through NEFilterDataProvider is returned immediately without doing any other work.
override func handleNewFlow(_ flow: NEFilterFlow) -> NEFilterNewFlowVerdict {
guard let socketFlow = flow as? NEFilterSocketFlow,
let auditToken = socketFlow.sourceAppAuditToken,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
return .filterDataVerdict(withFilterInbound: true, peekInboundBytes: Int.max, filterOutbound: true, peekOutboundBytes: Int.max)
}
override func handleInboundData(from flow: NEFilterFlow, readBytesStartOffset offset: Int, readBytes: Data) -> NEFilterDataVerdict {
guard let socketFlow = flow as? NEFilterSocketFlow,
let auditToken = socketFlow.sourceAppAuditToken,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
return NEFilterDataVerdict(passBytes: readBytes.count, peekBytes: Int.max)
}
override func handleOutboundData(from flow: NEFilterFlow, readBytesStartOffset offset: Int, readBytes: Data) -> NEFilterDataVerdict {
guard let socketFlow = flow as? NEFilterSocketFlow,
let auditToken = socketFlow.sourceAppAuditToken,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
return NEFilterDataVerdict(passBytes: readBytes.count, peekBytes: Int.max)
}
override func handleInboundDataComplete(for flow: NEFilterFlow) -> NEFilterDataVerdict {
guard let socketFlow = flow as? NEFilterSocketFlow,
let auditToken = socketFlow.sourceAppAuditToken,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
return .allow()
}
override func handleOutboundDataComplete(for flow: NEFilterFlow) -> NEFilterDataVerdict {
guard let socketFlow = flow as? NEFilterSocketFlow,
let auditToken = socketFlow.sourceAppAuditToken,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
return .allow()
}
how can i fix it?
I’m sorry I missed your reply [1]. The came up today in a different thread and I encourage you to bounce over there.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] The DevForums platform has ongoing issues with notifying folks of updates on threads. A few months back we fixed one of the more serious issues. However, this thread was before then, so it’s possible that I missed the update because of that.
It’s also possible that I fumbled something myself )-: