Add UDP Hole Punching for G2

This commit is contained in:
Geoffrey Merck 2018-11-02 09:17:18 +01:00
parent 3107a7f60e
commit d1c55b9394
3 changed files with 17 additions and 0 deletions

View file

@ -144,6 +144,18 @@ CAMBEData* CG2ProtocolHandler::readAMBE()
return data;
}
void CG2ProtocolHandler::PunchUDPHole(const wxString& address)
{
unsigned char buffer[1];
::memset(buffer, 0, 1);
in_addr addr = CUDPReaderWriter::lookup(address);
//wxLogError(wxT("Punching hole to %s"), address.mb_str());
m_socket.write(buffer, 1, addr, G2_DV_PORT);
}
void CG2ProtocolHandler::close()
{
m_socket.close();