In an iOS app I am making an audio file transfer using CoreBlueTooth
L2CAP channel
, between one device and another one. It is already half working but not yet entirely. At this point I have transferred the file name, but coming to the file contents, here is the situation.
On the sending side all the bytes are sent (a few hundred thousands bytes) spread over several chunks. But on the receiving side, only the first few thousands bytes seem to reach destination.
The function:
func stream(_ aStream: Stream,
handle eventCode: Stream.Event) {
......
}
is called once (with Stream.Event.hasBytesAvailable) and gets the first few thousands bytes. But then it is never called again. What could be the reason for that? I expect it to be called as many times as necessary until all the bytes have been received.