Select Git revision
SocketLecroy.cpp
-
Xavier ELATTAOUI authored
minor change
Xavier ELATTAOUI authoredminor change
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
SocketLecroy.cpp 8.43 KiB
//******************************************************************************************
//
//
// september 13, 2004 : Source file for the communication in socket mode
//
// with a Lecroy scope (avaiable for all models)
//
// author : X.Elattaoui
//
// SocketLecroy.cpp: implementation of the SocketLecroy class.
//
//******************************************************************************************
//- INCLUDE
#include "SocketLecroy.h"
//- init of the static instance
SocketLecroy* SocketLecroy::SL_instance = 0; //- ptr on the SocketLecroy instance
SocketLecroy* SocketLecroy::get_instance()
{
if( !SL_instance )
SL_instance = new SocketLecroy();
return SL_instance;
}
void SocketLecroy::delete_instance(SocketLecroy* SL_instance)
{
if(SL_instance)
{
delete SL_instance ;
SL_instance = 0;
}
}
//- CTOR
SocketLecroy::SocketLecroy()
{
sConnectedFlag=false;
}
//- DTOR
SocketLecroy::~SocketLecroy()
{
TCP_Disconnect();
}
//- Build the connection
void SocketLecroy::TCP_Connect(char *ip_address) throw (lecroy::SocketException)
{
SOCKADDR_IN serverAddr;
int sockAddrSize = sizeof (SOCKADDR), result;
const int resp = 1;
fd_set wr_set = {1, {0}};
TIMEVAL tval;
unsigned long argp;
char tmpStr[256];
//- connection test
if (sConnectedFlag)
return;
strcpy(sCurrentAddress, ip_address);