How to determine source of UDP queue resource buffer

  Kiến thức lập trình

Seeing the following error with the code below. How to determine what queue resource this is? This doesn’t appear on smaller data messsages.

nw_channel_get_output_frames failed to get packet from channel [35: Resource temporarily unavailable]
nw_protocol_ipv4_frame_output_finalizer [C3:2] 0x103409780 Not enough bytes to fragment 48142

Also seeing

nw_channel_get_output_frames failed to get packet from channel [35: Resource temporarily unavailable]
nw_protocol_ipv4_frame_output_finalizer [C3:2] 0x103409780 Not enough bytes to fragment 48142

it appears like some queue is empty, but I would assume for transmit that would be impossible.

   guard let codedAddress = IPv4Address(newAddress),
          let codedPort = NWEndpoint.Port(rawValue: NWEndpoint.Port.RawValue(newPort)) else {
        print("Failed to create connection address")
        return nil
    }
    address = .ipv4(codedAddress)
    port = codedPort
    

    connection = NWConnection(host: address, port: port, using: .udp)
    
  
    connection.stateUpdateHandler = { newState in
        switch (newState) {
        case .ready:
            print("State: Ready")
            return
        case .setup:
            print("State: Setup")
        case .cancelled:
            print("State: Cancelled")
        case .preparing:
            print("State: Preparing")
        default:
            print("ERROR! State not defined!n")
        }
    }
    connection.start(queue: .global())

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT