本文整理汇总了C++中EthernetUDP::stop方法的典型用法代码示例。如果您正苦于以下问题:C++ EthernetUDP::stop方法的具体用法?C++ EthernetUDP::stop怎么用?C++ EthernetUDP::stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EthernetUDP
的用法示例。
在下文中一共展示了EthernetUDP::stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: begin
SNMP_API_STAT_CODES SNMPClass::begin(const char *getCommName, const char *setCommName, const char *trapCommName, uint16_t port)
{
//initialize request counter
requestCounter = 1;
_extra_data_size = 0;
_udp_extra_data_packet = false;
// set community name set/get sizes
_setSize = strlen(setCommName);
_getSize = strlen(getCommName);
_trapSize = strlen(trapCommName);
//
// validate get/set community name sizes
if ( _setSize > SNMP_MAX_NAME_LEN + 1 || _getSize > SNMP_MAX_NAME_LEN + 1 || _trapSize > SNMP_MAX_NAME_LEN + 1) {
return SNMP_API_STAT_NAME_TOO_BIG;
}
//
// set community names
_getCommName = getCommName;
_setCommName = setCommName;
_trapCommName = trapCommName;
// validate session port number
if ( port == NULL || port == 0 ) port = SNMP_DEFAULT_PORT;
//
// init UDP socket
Udp.stop();
Udp.begin(port);
return SNMP_API_STAT_SUCCESS;
}
示例2: restartNtpTime
/*
* Restart our ntp handler. This is only done as part of restarting the
* network. As such, all we want to do is make sure udp is still working.
* We dont need to issue a time request unless one was already outstanding
* (not likely)
*/
void restartNtpTime() {
Udp.stop();
Udp.begin(8888);
// If we were already waiting for a response, let's re-issue the request
if (ntpState == WAITING_FOR_RESPONSE) {
sendTimeRequest();
}
}