私は1つのiPhone(またはiPod)から別のものに標準的なTCP接続を行う必要のあるIOSアプリケーションを開発します。接続は、シミュレータとデバイス上のアプリケーション間、および2台のシミュレータ間でうまく機能します。
アプリケーションはposix connect()を使用しています。他のモジュールが純粋なCであるため、このメソッドに固執する必要があります。
connect()アプリケーションブロックを呼び出すと、タイムアウトエラーが返されます。
通信はLANの無線LAN経由です
私はトラフィックを盗聴し、シミュレータに接続した後にデバイスがARPを送信し、応答後に標準的なTCPハンドシェイクが行われ、セッションが確立されたことがわかりました。
Same case with iPhone<>iPhone stops after ARP request, because another iPhone doesn't respond to it. Moreover iOS sends only gratuitous ARP (announces it's mac ip pair). My MAC seems like proceeding this request, because its ARP table has iPhone record, it doesn't work for another iPhone.
I've tried bonjour service, but it also works only with simulator <> device.
My question:
Is there any way to allow such communication? Is it possible it is problem with my iPhones only? Is there any explicit way to tell OS to send response for arps, or is it somehow blocked for traffic ios<>ios communication.