mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
receiverbug fixe affecting jungfrau receivers as root
This commit is contained in:
parent
a1a95ebb20
commit
22ed52605c
@ -112,7 +112,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
genericSocket(unsigned short int const port_number, communicationProtocol p,
|
genericSocket(unsigned short int const port_number, communicationProtocol p,
|
||||||
int ps = DEFAULT_PACKET_SIZE, const char *eth=NULL, int hsize=0,
|
int ps = DEFAULT_PACKET_SIZE, const char *eth=NULL, int hsize=0,
|
||||||
uint32_t buf_size=SOCKET_BUFFER_SIZE):
|
uint64_t buf_size=SOCKET_BUFFER_SIZE):
|
||||||
portno(port_number),
|
portno(port_number),
|
||||||
protocol(p),
|
protocol(p),
|
||||||
is_a_server(1),
|
is_a_server(1),
|
||||||
@ -181,10 +181,10 @@ public:
|
|||||||
|
|
||||||
//increase socket buffer size if its udp
|
//increase socket buffer size if its udp
|
||||||
if (p == UDP) {
|
if (p == UDP) {
|
||||||
uint32_t desired_size = buf_size;
|
uint64_t desired_size = buf_size;
|
||||||
uint32_t real_size = desired_size * 2; // kernel doubles this value for bookkeeping overhead
|
uint64_t real_size = desired_size * 2; // kernel doubles this value for bookkeeping overhead
|
||||||
uint32_t ret_size = -1;
|
uint64_t ret_size = -1;
|
||||||
socklen_t optlen = sizeof(int);
|
socklen_t optlen = sizeof(uint64_t);
|
||||||
|
|
||||||
// confirm if sufficient
|
// confirm if sufficient
|
||||||
if (getsockopt(sockfd.fd, SOL_SOCKET, SO_RCVBUF, &ret_size, &optlen) == -1) {
|
if (getsockopt(sockfd.fd, SOL_SOCKET, SO_RCVBUF, &ret_size, &optlen) == -1) {
|
||||||
@ -268,7 +268,7 @@ public:
|
|||||||
* Halving is because of kernel book keeping
|
* Halving is because of kernel book keeping
|
||||||
* @returns actual udp socket buffer size/2
|
* @returns actual udp socket buffer size/2
|
||||||
*/
|
*/
|
||||||
int getActualUDPSocketBufferSize(){return actual_udp_socket_buffer_size;};
|
uint64_t getActualUDPSocketBufferSize(){return actual_udp_socket_buffer_size;};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get protocol TCP or UDP
|
* Get protocol TCP or UDP
|
||||||
@ -831,5 +831,5 @@ private:
|
|||||||
int nsent;
|
int nsent;
|
||||||
int total_sent;
|
int total_sent;
|
||||||
int header_packet_size;
|
int header_packet_size;
|
||||||
int actual_udp_socket_buffer_size;
|
int64_t actual_udp_socket_buffer_size;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user