diff --git a/slsDetectorSoftware/MySocketTCP/genericSocket.h b/slsDetectorSoftware/MySocketTCP/genericSocket.h index 00d5dc497..3a0a005fd 100644 --- a/slsDetectorSoftware/MySocketTCP/genericSocket.h +++ b/slsDetectorSoftware/MySocketTCP/genericSocket.h @@ -221,6 +221,14 @@ enum communicationProtocol{ socketDescriptor=-1; return; } + + //increase buffer size if its udp + if((communicationProtocol == UDP) && (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &SOCKET_BUFFER_SIZE, sizeof(int)) == -1)) + { + cerr << "Cannot set socket receive buffer size" << endl; + } + + if (getProtocol()==SOCK_STREAM) listen(socketDescriptor, DEFAULT_BACKLOG); diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h index 10c704b2b..3f8cc44f9 100755 --- a/slsDetectorSoftware/commonFiles/sls_detector_defs.h +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -19,6 +19,8 @@ #define MAXDET 100 /** header length for data :gotthard*/ #define HEADERLENGTH 12 +/** udp socket buffer size - 100MB*/ +#define SOCKET_BUFFER_SIZE (100*1024*1024) /** maximum rois */ #define MAX_ROIS 100