mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-08 14:58:41 +01:00
Dev/fix port size (#805)
* port datatype changing from int to uint16_t * throwing for -1 given for uint16_t ports
This commit is contained in:
@@ -15,7 +15,7 @@ namespace sls {
|
||||
|
||||
using namespace rapidjson;
|
||||
ZmqSocket::ZmqSocket(const char *const hostname_or_ip,
|
||||
const uint32_t portnumber)
|
||||
const uint16_t portnumber)
|
||||
: portno(portnumber), sockfd(false) {
|
||||
// Extra check that throws if conversion fails, could be removed
|
||||
auto ipstr = HostnameToIp(hostname_or_ip).str();
|
||||
@@ -55,7 +55,7 @@ ZmqSocket::ZmqSocket(const char *const hostname_or_ip,
|
||||
<< GetReceiveHighWaterMark();
|
||||
}
|
||||
|
||||
ZmqSocket::ZmqSocket(const uint32_t portnumber, const char *ethip)
|
||||
ZmqSocket::ZmqSocket(const uint16_t portnumber, const char *ethip)
|
||||
: portno(portnumber), sockfd(true) {
|
||||
// create context
|
||||
sockfd.contextDescriptor = zmq_ctx_new();
|
||||
@@ -289,24 +289,24 @@ int ZmqSocket::ReceiveHeader(const int index, zmqHeader &zHeader,
|
||||
header_buffer.get(), MAX_STR_LENGTH, 0);
|
||||
if (bytes_received > 0) {
|
||||
#ifdef ZMQ_DETAIL
|
||||
cprintf(BLUE, "Header %d [%d] Length: %d Header:%s \n", index, portno,
|
||||
cprintf(BLUE, "Header %d [%hu] Length: %d Header:%s \n", index, portno,
|
||||
bytes_received, header_buffer.get());
|
||||
#endif
|
||||
if (ParseHeader(index, bytes_received, header_buffer.get(), zHeader,
|
||||
version)) {
|
||||
#ifdef ZMQ_DETAIL
|
||||
cprintf(RED, "Parsed Header %d [%d] Length: %d Header:%s \n", index,
|
||||
portno, bytes_received, header_buffer.get());
|
||||
cprintf(RED, "Parsed Header %d [%hu] Length: %d Header:%s \n",
|
||||
index, portno, bytes_received, header_buffer.get());
|
||||
#endif
|
||||
if (!zHeader.data) {
|
||||
#ifdef ZMQ_DETAIL
|
||||
cprintf(RED, "%d [%d] Received end of acquisition\n", index,
|
||||
cprintf(RED, "%d [%hu] Received end of acquisition\n", index,
|
||||
portno);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#ifdef ZMQ_DETAIL
|
||||
cprintf(GREEN, "%d [%d] data\n", index, portno);
|
||||
cprintf(GREEN, "%d [%hu] data\n", index, portno);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user