diff --git a/commonFiles/MySocketTCP.cpp b/commonFiles/MySocketTCP.cpp deleted file mode 100644 index b34231352..000000000 --- a/commonFiles/MySocketTCP.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -//version 1.0, base development, Ian 19/01/09 - - -#include "MySocketTCP.h" -#include -#include -#include - - - - -int MySocketTCP::SendData(void* buf,int length){//length in characters - int ndata = SendDataAndKeepConnection(buf,length); - Disconnect(); - return ndata; -} - -int MySocketTCP::SendDataAndKeepConnection(void* buf,int length){//length in characters - if(last_keep_connection_open_action_was_a_send) Disconnect(); //to keep a structured data flow; - - Connect(); - int total_sent=SendDataOnly(buf,length); - last_keep_connection_open_action_was_a_send=1; - return total_sent; -} - - - - -int MySocketTCP::ReceiveData(void* buf,int length){//length in characters - int ndata = ReceiveDataAndKeepConnection(buf,length); - Disconnect(); - return ndata; -} - -int MySocketTCP::ReceiveDataAndKeepConnection(void* buf,int length){//length in characters - if(!last_keep_connection_open_action_was_a_send) Disconnect(); //to a keep structured data flow; - - Connect(); - // should preform two reads one to receive incomming char count - int total_received=ReceiveDataOnly(buf,length); - last_keep_connection_open_action_was_a_send=0; - return total_received; -} - diff --git a/commonFiles/MySocketTCP.h b/commonFiles/MySocketTCP.h index a3f6ea285..910528dcb 100644 --- a/commonFiles/MySocketTCP.h +++ b/commonFiles/MySocketTCP.h @@ -41,27 +41,9 @@ developed and class MySocketTCP: public genericSocket { public: - MySocketTCP(const char* const host_ip_or_name, unsigned short int const port_number): genericSocket(host_ip_or_name, port_number,TCP), last_keep_connection_open_action_was_a_send(0){setPacketSize(TCP_PACKET_SIZE);}; // sender (client): where to? ip - MySocketTCP(unsigned short int const port_number):genericSocket(port_number,TCP), last_keep_connection_open_action_was_a_send(0) {setPacketSize(TCP_PACKET_SIZE);}; // receiver (server) local no need for ip + MySocketTCP(const char* const host_ip_or_name, unsigned short int const port_number): genericSocket(host_ip_or_name, port_number,TCP){setPacketSize(TCP_PACKET_SIZE);}; // sender (client): where to? ip + MySocketTCP(unsigned short int const port_number):genericSocket(port_number,TCP) {setPacketSize(TCP_PACKET_SIZE);}; // receiver (server) local no need for ip virtual ~MySocketTCP(){}; - //The following two functions will connectioned->send/receive->disconnect - int SendData(void* buf,int length);//length in characters - int ReceiveData(void* buf,int length); - - - //The following two functions stay connected, blocking other connections, and must be manually disconnected, - // when the last call is a SendData() or ReceiveData() the disconnection will be done automatically - //These function will also automatically disconnect->reconnect if - // two reads (or two writes) are called in a row to preserve the data send/receive structure - int SendDataAndKeepConnection(void* buf,int length); - int ReceiveDataAndKeepConnection(void* buf,int length); - - private: - - - bool last_keep_connection_open_action_was_a_send; - - }; diff --git a/slsDetectorGui/client/Makefile b/slsDetectorGui/client/Makefile index a635b179c..2b74aba13 100644 --- a/slsDetectorGui/client/Makefile +++ b/slsDetectorGui/client/Makefile @@ -6,7 +6,7 @@ LDIR = ../../slsDetectorSoftware RDIR = ../../slsReceiverSoftware DDIR = ../../bin INCLUDES = -I ../../commonFiles -I $(LDIR)/slsDetector -I ../include -I $(RDIR)/include -SRC_CLNT = qClient.cpp $(RDIR)/src/MySocketTCP.cpp +SRC_CLNT = qClient.cpp DEPSINCLUDES= qClient.h $(RDIR)/include/MySocketTCP.h $(LDIR)/slsDetector/slsDetectorBase.h ../../commonFiles/sls_detector_defs.h diff --git a/slsDetectorSoftware/Makefile b/slsDetectorSoftware/Makefile index f64415cbc..3fa02c3a8 100644 --- a/slsDetectorSoftware/Makefile +++ b/slsDetectorSoftware/Makefile @@ -16,7 +16,7 @@ INCLUDES?= -I../commonFiles -IslsDetector -ImultiSlsDetector -IslsReceiverInte LIBZMQDIR = ../commonFiles LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq -SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp sharedMemory/SharedMemory.cpp ../commonFiles/utilities.cpp#../slsReceiverSoftware/MySocketTCP/MySocketTCP.cpp +SRC_CLNT= slsDetector/slsDetectorCommand.cpp slsDetector/slsDetector.cpp multiSlsDetector/multiSlsDetector.cpp slsReceiverInterface/receiverInterface.cpp slsDetector/slsDetectorUsers.cpp sharedMemory/SharedMemory.cpp ../commonFiles/utilities.cpp DEPSINCLUDES = ../commonFiles/sls_receiver_defs.h ../commonFiles/sls_receiver_funcs.h ../commonFiles/ansi.h ../commonFiles/sls_detector_defs.h ../commonFiles/sls_detector_funcs.h ../commonFiles/error_defs.h slsDetector/slsDetectorBase.h slsDetector/detectorData.h sharedMemory/SharedMemory.h ../commonFiles/sls_receiver_exceptions.h ../commonFiles/versionAPI.h ../commonFiles/utilities.h ../slsSupportLib/include/container_utils.h diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index 12d40316c..07da638a5 100644 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -1,5 +1,4 @@ set(SOURCES - src/MySocketTCP.cpp src/UDPInterface.cpp src/UDPBaseImplementation.cpp src/UDPStandardImplementation.cpp diff --git a/slsReceiverSoftware/Makefile b/slsReceiverSoftware/Makefile index 527055b59..3f76c46c8 100644 --- a/slsReceiverSoftware/Makefile +++ b/slsReceiverSoftware/Makefile @@ -26,7 +26,7 @@ LIBZMQ = -L$(LIBZMQDIR) -Wl,-rpath=$(LIBZMQDIR) -lzmq -SRC_CLNT = MySocketTCP.cpp ThreadObject.cpp Listener.cpp DataProcessor.cpp DataStreamer.cpp Fifo.cpp File.cpp BinaryFile.cpp UDPInterface.cpp UDPBaseImplementation.cpp UDPStandardImplementation.cpp slsReceiverTCPIPInterface.cpp slsReceiver.cpp slsReceiverUsers.cpp $(COMMONDIR)/utilities.cpp +SRC_CLNT = ThreadObject.cpp Listener.cpp DataProcessor.cpp DataStreamer.cpp Fifo.cpp File.cpp BinaryFile.cpp UDPInterface.cpp UDPBaseImplementation.cpp UDPStandardImplementation.cpp slsReceiverTCPIPInterface.cpp slsReceiver.cpp slsReceiverUsers.cpp $(COMMONDIR)/utilities.cpp DEPSINCLUDES = $(COMMONDIR)/ansi.h $(COMMONDIR)/sls_receiver_defs.h $(COMMONDIR)/sls_receiver_funcs.h $(COMMONDIR)/GeneralData.h $(INCDIR)/circularFifo.h $(COMMONDIR)/genericSocket.h $(COMMONDIR)/logger.h $(INCDIR)/receiver_defs.h $(INCDIR)/UDPInterface.h $(COMMONDIR)/utilities.h $(COMMONDIR)/ZmqSocket.h $(INCDIR)/BinaryFileStatic.h $(INCDIR)/HDF5FileStatic.h $(COMMONDIR)/sls_receiver_exceptions.h