mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-05 20:30:03 +02:00
edited generic socket for udp socket, prob:gap in files when using smaller buffers
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@357 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
c02075dc12
commit
a781ca3422
@ -515,8 +515,10 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(DEFA
|
||||
break;
|
||||
case UDP:
|
||||
if (socketDescriptor<0) return -1;
|
||||
while(length>0){
|
||||
nsending = (length>packet_size) ? packet_size:length;
|
||||
// while(length>0){
|
||||
for(int i=0;i<2;i++){
|
||||
nsending=packet_size;
|
||||
//nsending = (length>packet_size) ? packet_size:length;
|
||||
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
|
||||
if(!nsent) break;
|
||||
length-=nsent;
|
||||
|
@ -37,6 +37,7 @@ int main(int argc, char *argv[])
|
||||
if(ret==slsDetectorDefs::FAIL)
|
||||
return -1;
|
||||
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "Function table assigned." << endl;
|
||||
#endif
|
||||
|
@ -111,7 +111,7 @@ void slsReceiverFunctionList::closeFile(int p){
|
||||
cout << "Closing file and Exiting." << endl;
|
||||
fclose(sfilefd);
|
||||
}
|
||||
exit(0);
|
||||
//exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "slsReceiver_funcs.h"
|
||||
#include "slsReceiverFunctionList.h"
|
||||
|
||||
#include <signal.h> // SIGINT
|
||||
//#include <signal.h> //SIGINT
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -15,6 +15,9 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
slsReceiverFuncs::slsReceiverFuncs(MySocketTCP *&mySocket,string const fname,int &success, bool shortfname):
|
||||
socket(mySocket),
|
||||
ret(OK),
|
||||
@ -197,10 +200,7 @@ int slsReceiverFuncs::M_nofunc(){
|
||||
/*
|
||||
void slsReceiverFuncs::closeFile(int p){
|
||||
//if(socket)
|
||||
slsReceiverFunctionList::closeFile(0);
|
||||
socket->Disconnect();//non static
|
||||
delete socket;
|
||||
exit(0);
|
||||
slsReceiverFunctionList::closeFile();
|
||||
}
|
||||
*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user