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

View File

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