sorted receiver client interface, more consistent

This commit is contained in:
Dhanya Maliakal
2017-07-03 13:31:17 +02:00
parent f8c04a6a51
commit b03e35a8d6
6 changed files with 384 additions and 245 deletions

View File

@ -586,7 +586,12 @@ enum communicationProtocol{
while(length>0){
nsending = (length>packet_size) ? packet_size:length;
nsent = read(file_des,(char*)buf+total_sent,nsending);
if(!nsent) break;
if(!nsent) {
if(!total_sent) {
return -1; //to handle it
}
break;
}
length-=nsent;
total_sent+=nsent;
}
@ -668,6 +673,10 @@ enum communicationProtocol{
while(length>0){
nsending = (length>packet_size) ? packet_size:length;
nsent = write(file_des,(char*)buf+total_sent,nsending);
if(is_a_server && nsent < 0) {
cprintf(BG_RED, "Error writing to socket. Possible client socket crash\n");
break;
}
if(!nsent) break;
length-=nsent;
total_sent+=nsent;
@ -691,8 +700,6 @@ enum communicationProtocol{
cout << "sent "<< total_sent << " Bytes" << endl;
#endif
return total_sent;
}

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git"
//#define SVNREPPATH ""
#define SVNREPUUID "670a57a1231e27ccdc01bcede88e3ae053b2a3f1"
//#define SVNREV 0x603
#define SVNREPUUID "55bce97b990e627682fc8dc7b38ed883fe155fde"
//#define SVNREV 0x604
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTH "Dhanya_Maliakal"
#define SVNREV 0x603
#define SVNREV 0x604
#define SVNDATE 0x20170630
//

View File

@ -294,9 +294,6 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
/** thread for TCP server */
pthread_t TCPServer_thread;
/** size of one frame*/
int tenGigaEnable;
/** port number */
int portNumber;