MCPcopy Create free account
hub / github.com/amule-project/amule / Connect

Method Connect

src/BaseClient.cpp:1605–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1603}
1604
1605bool CUpDownClient::Connect()
1606{
1607 m_hasbeenobfuscatinglately = false;
1608
1609 if (!m_socket->IsOk()) {
1610 // Enable or disable crypting based on our and the remote clients preference
1611 if (HasValidHash() && SupportsCryptLayer() && thePrefs::IsClientCryptLayerSupported() && (RequestsCryptLayer() || thePrefs::IsClientCryptLayerRequested())){
1612 m_socket->SetConnectionEncryption(true, GetUserHash().GetHash(), false);
1613 } else {
1614 m_socket->SetConnectionEncryption(false, NULL, false);
1615 }
1616 amuleIPV4Address tmp;
1617 tmp.Hostname(GetConnectIP());
1618 tmp.Service(GetUserPort());
1619 AddDebugLogLineN(logClient, "Trying to connect to " + Uint32_16toStringIP_Port(GetConnectIP(),GetUserPort()));
1620 m_socket->Connect(tmp, false);
1621 // We should send hello packets AFTER connecting!
1622 // so I moved it to OnConnect
1623 return true;
1624 } else {
1625 return false;
1626 }
1627}
1628
1629void CUpDownClient::ConnectionEstablished()
1630{

Callers

nothing calls this directly

Calls 6

Uint32_16toStringIP_PortFunction · 0.85
ServiceMethod · 0.80
IsOkMethod · 0.45
GetHashMethod · 0.45
HostnameMethod · 0.45

Tested by

no test coverage detected