本文整理汇总了C++中CHeaderData::getYourPort方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderData::getYourPort方法的具体用法?C++ CHeaderData::getYourPort怎么用?C++ CHeaderData::getYourPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHeaderData
的用法示例。
在下文中一共展示了CHeaderData::getYourPort方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeHeader
bool CHBRepeaterProtocolHandler::writeHeader(CHeaderData& header)
{
unsigned char buffer[50U];
unsigned int length = header.getHBRepeaterData(buffer, 50U, true);
#if defined(DUMP_TX)
CUtils::dump(wxT("Sending Header"), buffer, length);
return true;
#else
return m_socket.write(buffer, length, header.getYourAddress(), header.getYourPort());
#endif
}
示例2: sendHeader
bool CAPRSTransmit::sendHeader(const CHeaderData& header)
{
unsigned char buffer[60U];
unsigned int length = header.getG2Data(buffer, 60U, true);
for (unsigned int i = 0U; i < 2U; i++) {
bool res = m_socket.write(buffer, length, header.getYourAddress(), header.getYourPort());
if (!res)
return false;
}
return true;
}
示例3: writeHeader
bool CDPlusProtocolHandler::writeHeader(const CHeaderData& header)
{
unsigned char buffer[60U];
unsigned int length = header.getDPlusData(buffer, 60U, true);
#if defined(DUMP_TX)
CUtils::dump(wxT("Sending Header"), buffer, length);
#endif
for (unsigned int i = 0U; i < 5U; i++) {
bool res = m_socket.write(buffer, length, header.getYourAddress(), header.getYourPort());
if (!res)
return false;
}
return true;
}
示例4: process
void CDPlusHandler::process(CHeaderData& header)
{
in_addr yourAddress = header.getYourAddress();
unsigned int yourPort = header.getYourPort();
unsigned int myPort = header.getMyPort();
for (unsigned int i = 0U; i < m_maxReflectors; i++) {
CDPlusHandler* reflector = m_reflectors[i];
if (reflector != NULL) {
if (reflector->m_yourAddress.s_addr == yourAddress.s_addr &&
reflector->m_yourPort == yourPort &&
reflector->m_myPort == myPort) {
reflector->processInt(header);
return;
}
}
}
}
示例5: write
void CHeaderLogger::write(const wxChar* type, const CHeaderData& header)
{
wxASSERT(type != NULL);
time_t timeNow = ::time(NULL);
struct tm* tm = ::gmtime(&timeNow);
char* t = ::inet_ntoa(header.getYourAddress());
wxString address(t, wxConvLocal);
wxString text;
text.Printf(wxT("%04d-%02d-%02d %02d:%02d:%02d: %s header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s Flags: %02X %02X %02X (%s:%u)\n"),
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, type,
header.getMyCall1().c_str(), header.getMyCall2().c_str(), header.getYourCall().c_str(),
header.getRptCall1().c_str(), header.getRptCall2().c_str(), header.getFlag1(), header.getFlag2(),
header.getFlag3(), address.c_str(), header.getYourPort());
m_file.Write(text);
m_file.Flush();
}