0

私のアプリケーションではGCDAsyncUdpSocket、UDP パケット通信に使用しています...

以下のようなコードを書きました

GCDAsyncUdpSocket* UDPSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];

 [UDPSocket sendData:dataForSendToServer toHost:stringForHostId port:portNumber withTimeout:5 tag:1];

パケットがタイムアウトした場合、Timeout プロパティを使用してパケットを再送信するのが好きです...

GCDAsyncUdpSocketAPIドキュメントでは、

The timeout for the send opeartion. If the timeout value is negative, the send operation will not use a timeout."

したがって、-1 のタイムアウトは、パケットを自動的に再送信するように機能しますか?..またはそれを行う他の方法はありますか?

前もって感謝します。

4

1 に答える 1