mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 08:38:00 +02:00
switching udpsocketbuffersize from uitn64_t to int64_t, printing socket exception into tcp error mess, changing an exception message
This commit is contained in:
@ -22,7 +22,7 @@ const std::string Listener::TypeName = "Listener";
|
||||
|
||||
Listener::Listener(int ind, detectorType dtype, Fifo* f, runStatus* s,
|
||||
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
|
||||
uint64_t* us, uint64_t* as, uint32_t* fpf,
|
||||
int64_t* us, int64_t* as, uint32_t* fpf,
|
||||
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm) :
|
||||
ThreadObject(ind),
|
||||
runningFlag(0),
|
||||
@ -232,7 +232,7 @@ void Listener::ShutDownUDPSocket() {
|
||||
}
|
||||
|
||||
|
||||
int Listener::CreateDummySocketForUDPSocketBufferSize(uint64_t s) {
|
||||
int Listener::CreateDummySocketForUDPSocketBufferSize(int64_t s) {
|
||||
FILE_LOG(logINFO) << "Testing UDP Socket Buffer size with test port " << *udpPortNumber;
|
||||
|
||||
if (!(*activated)) {
|
||||
@ -240,7 +240,7 @@ int Listener::CreateDummySocketForUDPSocketBufferSize(uint64_t s) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
uint64_t temp = *udpSocketBufferSize;
|
||||
int64_t temp = *udpSocketBufferSize;
|
||||
*udpSocketBufferSize = s;
|
||||
|
||||
//if eth is mistaken with ip address
|
||||
|
@ -373,12 +373,12 @@ std::string slsReceiverImplementation::getAdditionalJsonHeader() const{
|
||||
return std::string(additionalJsonHeader);
|
||||
}
|
||||
|
||||
uint64_t slsReceiverImplementation::getUDPSocketBufferSize() const {
|
||||
int64_t slsReceiverImplementation::getUDPSocketBufferSize() const {
|
||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
return udpSocketBufferSize;
|
||||
}
|
||||
|
||||
uint64_t slsReceiverImplementation::getActualUDPSocketBufferSize() const {
|
||||
int64_t slsReceiverImplementation::getActualUDPSocketBufferSize() const {
|
||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
return actualUDPSocketBufferSize;
|
||||
}
|
||||
@ -610,7 +610,7 @@ void slsReceiverImplementation::setEthernetInterface(const char* c) {
|
||||
FILE_LOG(logINFO) << "Ethernet Interface: " << eth;
|
||||
}
|
||||
|
||||
int slsReceiverImplementation::setUDPSocketBufferSize(const uint64_t s) {
|
||||
int slsReceiverImplementation::setUDPSocketBufferSize(const int64_t s) {
|
||||
if (listener.size())
|
||||
return listener[0]->CreateDummySocketForUDPSocketBufferSize(s);
|
||||
return FAIL;
|
||||
|
@ -425,11 +425,12 @@ int slsReceiverTCPIPInterface::set_port() {
|
||||
strcpy(mySock->lastClientIP,oldLastClientIP);
|
||||
} catch(SocketError &e) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not bind port %d. It is already set\n", p_number);
|
||||
// same socket, could not bind port
|
||||
sprintf(mess, e.what());
|
||||
FILE_LOG(logERROR) << mess;
|
||||
} catch (...) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not bind port %d.\n", p_number);
|
||||
sprintf(mess, "Could not set port %d.\n", p_number);
|
||||
FILE_LOG(logERROR) << mess;
|
||||
}
|
||||
}
|
||||
@ -1728,8 +1729,8 @@ int slsReceiverTCPIPInterface::get_additional_json_header() {
|
||||
int slsReceiverTCPIPInterface::set_udp_socket_buffer_size() {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
uint64_t index = -1;
|
||||
uint64_t retval = -1;
|
||||
int64_t index = -1;
|
||||
int64_t retval = -1;
|
||||
|
||||
// get args, return if socket crashed, ret is fail if receiver is not null
|
||||
if (interface->Server_ReceiveArg(ret, mess, &index, sizeof(index), true, receiver) == FAIL)
|
||||
@ -1762,7 +1763,7 @@ int slsReceiverTCPIPInterface::set_udp_socket_buffer_size() {
|
||||
int slsReceiverTCPIPInterface::get_real_udp_socket_buffer_size(){
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
uint64_t retval = -1;
|
||||
int64_t retval = -1;
|
||||
|
||||
// no arg, check receiver is null
|
||||
interface->Server_ReceiveArg(ret, mess, nullptr, 0, true, receiver);
|
||||
|
Reference in New Issue
Block a user