some minor tweaks

This commit is contained in:
Robin Müller 2020-09-06 12:00:57 +02:00
parent 7774434d7a
commit 8db9a4a191
2 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@ TcWinUdpPollingTask::~TcWinUdpPollingTask() {}
ReturnValue_t TcWinUdpPollingTask::performOperation(uint8_t opCode) { ReturnValue_t TcWinUdpPollingTask::performOperation(uint8_t opCode) {
// Poll for new UDP datagrams in permanent loop. // Poll for new UDP datagrams in permanent loop.
while(1) { while(true) {
//! Sender Address is cached here. //! Sender Address is cached here.
struct sockaddr_in senderAddress; struct sockaddr_in senderAddress;
int senderAddressSize = sizeof(senderAddress); int senderAddressSize = sizeof(senderAddress);
@ -48,8 +48,8 @@ ReturnValue_t TcWinUdpPollingTask::performOperation(uint8_t opCode) {
handleReadError(); handleReadError();
continue; continue;
} }
sif::debug << "TcSocketPollingTask::performOperation: " << bytesReceived //sif::debug << "TcWinUdpPollingTask::performOperation: " << bytesReceived
<< " bytes received" << std::endl; // << " bytes received" << std::endl;
ReturnValue_t result = handleSuccessfullTcRead(bytesReceived); ReturnValue_t result = handleSuccessfullTcRead(bytesReceived);
if(result != HasReturnvaluesIF::RETURN_FAILED) { if(result != HasReturnvaluesIF::RETURN_FAILED) {
@ -135,7 +135,6 @@ void TcWinUdpPollingTask::handleReadError() {
case(WSAEFAULT): { case(WSAEFAULT): {
sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: " sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: "
<< "Bad address " << std::endl; << "Bad address " << std::endl;
Sleep(2000);
break; break;
} }
default: { default: {
@ -144,4 +143,6 @@ void TcWinUdpPollingTask::handleReadError() {
break; break;
} }
} }
// to prevent spam.
Sleep(1000);
} }

View File

@ -41,8 +41,7 @@ TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId,
serverAddress.sin_family = AF_INET; serverAddress.sin_family = AF_INET;
// Accept packets from any interface. // Accept packets from any interface. (potentially insecure).
//serverAddress.sin_addr.s_addr = inet_addr("127.73.73.0");
serverAddress.sin_addr.s_addr = htonl(INADDR_ANY); serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);
serverAddress.sin_port = htons(setServerPort); serverAddress.sin_port = htons(setServerPort);
serverAddressLen = sizeof(serverAddress); serverAddressLen = sizeof(serverAddress);