NWConnection speed limit

I have camera device in Wifi mode AP. I'm connecting to that device via Wifi using NEConnection to specific port. TCP protocol.

Then using API I'm building specific message, converting them to Data and sending to Camera device.

We have 2 ports, one for messages other for data transferring.

Issue is: While receiving data from device we have speed ± 160 KB/s, but android with the same configurations has 2MB/s.

Why it happens, does Apple makes some speed limitation? Could it be related to Wifi as it doesn't has internet connection?

NWConnection constructor:

static func createConnection(host hostAddress: String, port portInt: UInt16) -> NWConnection {
    let ipv4: IPv4Address = .init(hostAddress) ?? .any
    let host: NWEndpoint.Host = .ipv4(ipv4)
    let port: NWEndpoint.Port = .init(rawValue: portInt) ?? .any
     
    let tcpOptions: NWProtocolTCP.Options = NWProtocolTCP.Options.init()
     
    return .init(host: host, port: port, using: .init(tls: nil, tcp: tcpOptions))
  }

For those reading along at home, I’ll be helping shevchykv in a different context.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NWConnection speed limit
 
 
Q