From b5e216db684e088b06709722408d88ae3129f78a Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 16 Sep 2016 17:21:42 -0700 Subject: [PATCH] ice test-client uses stun server to get public address --- tools/ice-client/src/ICEClientApp.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/ice-client/src/ICEClientApp.h b/tools/ice-client/src/ICEClientApp.h index efdbc9e022..eee759b2ba 100644 --- a/tools/ice-client/src/ICEClientApp.h +++ b/tools/ice-client/src/ICEClientApp.h @@ -27,14 +27,29 @@ public: ~ICEClientApp(); private: + enum State { + lookUpStunServer, // 0 + sendStunRequestPacket, // 1 + waitForStunResponse, // 2 + talkToIceServer, // 3 + waitForIceReply, // 4 + pause0, // 5 + pause1 // 6 + }; + + void setState(int newState); + void doSomething(); void sendPacketToIceServer(PacketType packetType, const HifiSockAddr& iceServerSockAddr, const QUuid& clientID, const QUuid& peerID); void icePingDomainServer(); + void processSTUNResponse(std::unique_ptr packet); void processPacket(std::unique_ptr packet); bool _verbose; + HifiSockAddr _stunSockAddr; + unsigned int _actionCount { 0 }; unsigned int _actionMax { 0 }; @@ -52,10 +67,6 @@ private: bool _domainServerPeerSet { false }; NetworkPeer _domainServerPeer; - // 0 -- time to talk to ice server - // 1 -- waiting for ICEPingReply - // 2 -- pause - // 3 -- pause int _state { 0 }; };