Skip to content

Commit

Permalink
Removing the timed ping facility from PeerConnectionClient...
Browse files Browse the repository at this point in the history
  • Loading branch information
Manjesh Malavalli committed Dec 16, 2011
1 parent d94934f commit a07b2a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/js_api/projects/WebrtcPlugin/WPLPeerConnectionClient.cpp
Expand Up @@ -46,7 +46,7 @@ namespace GoCast
PeerConnectionClient::~PeerConnectionClient()
{
delete m_pCall;
delete m_pTimedServerPing;
//delete m_pTimedServerPing;
}

int PeerConnectionClient::id() const
Expand All @@ -66,7 +66,7 @@ namespace GoCast
m_pMsgQ(pMsgQ),
m_pEvtQ(pEvtQ),
state_(NOT_CONNECTED),
m_pTimedServerPing(new TimedPing(m_pMsgQ, 5000000)),
//m_pTimedServerPing(new TimedPing(m_pMsgQ, 5000000)),
m_bAudioOnly(bAudioOnly),
my_id_(-1),
m_PeerName(peerName),
Expand Down Expand Up @@ -407,12 +407,16 @@ namespace GoCast
return false;
}

std::cout << "Stage 1" << std::endl;

ASSERT(is_connected());
if (!is_connected() || peer_id == -1)
{
return false;
}

std::cout << "Stage 2" << std::endl;

char headers[1024];
sprintfn(headers, sizeof(headers),
"POST /message?peer_id=%i&to=%i HTTP/1.0\r\n"
Expand Down Expand Up @@ -483,6 +487,7 @@ namespace GoCast
int err = control_socket_->Connect(server_address_);
if (err == SOCKET_ERROR)
{
std::cout << "Stage 3" << std::endl;
Close();
return false;
}
Expand Down Expand Up @@ -707,7 +712,7 @@ namespace GoCast
ParsedMessage cmd;
cmd["command"] = "initpeerconnfactory";
m_pMsgQ->PostMessage(cmd);
m_pTimedServerPing->startThread();
//m_pTimedServerPing->startThread();

if(NULL != m_pEvtQ)
{
Expand All @@ -732,7 +737,7 @@ namespace GoCast
ParsedMessage cmd;
cmd["command"] = "deinitpeerconnfactory";
m_pMsgQ->PostMessage(cmd);
m_pTimedServerPing->stopThread();
//m_pTimedServerPing->stopThread();
}
else if (state_ == SIGNING_OUT_WAITING)
{
Expand Down
6 changes: 4 additions & 2 deletions src/js_api/projects/WebrtcPlugin/WPLPeerConnectionClient.h
Expand Up @@ -27,7 +27,8 @@ typedef std::map<int, std::string> Peers;
typedef std::map<std::string, std::string> ParsedMessage;

namespace GoCast
{
{
#if 0
class TimedPing : public ThreadSingle
{
public:
Expand Down Expand Up @@ -58,6 +59,7 @@ namespace GoCast
ThreadSafeMessageQueue* m_pMsgQ;
int m_periodMus;
};
#endif

/**
Handles signaling between peers with the aid of a signin server.
Expand Down Expand Up @@ -231,7 +233,7 @@ namespace GoCast
*/
State state_;

TimedPing* m_pTimedServerPing;
//TimedPing* m_pTimedServerPing;
bool m_bAudioOnly;
int my_id_;

Expand Down

0 comments on commit a07b2a1

Please sign in to comment.