Skip to content
Snippets Groups Projects
Select Git revision
  • 1a7bc1ee7457b589523e7bad47f646c3d8e1a9ef
  • main default protected
  • release_1_2_1
  • release_1_2_0
  • release_1_1_19
  • release_1_1_18
  • release_1_1_17
  • release_1_1_16
  • release_1_1_15
  • release_1_1_14
  • release_1_1_13
  • release_1_1_12
  • release_1_1_11
  • release_1_1_10
  • release_1_1_9
  • release_1_1_8
  • release_1_1_7
  • release_1_1_6
  • release_1_1_5
  • release_1_1_4
  • release_1_1_3
  • release_1_1_2
22 results

Win32SocketLecroy.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Win32SocketLecroy.cpp 9.24 KiB
    //*******************************************************************************
    //* Copyright (c) 2008-2014 Synchrotron SOLEIL
    //* All rights reserved. This program and the accompanying materials
    //* are made available under the terms of the GNU Lesser Public License v3
    //* which accompanies this distribution, and is available at
    //* http://www.gnu.org/licenses/lgpl.html
    //******************************************************************************
    //******************************************************************************************
    //
    //
    //		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.
    //
    //******************************************************************************************
    
    static int	hSocket;
    static int	sTimeout = 15;
    //static int	sWinsockInitFlag = FALSE;
    static char	sCurrentAddress[256];
    static int 	sConnectedFlag = false;
    const int	CMD_BUF_LEN	= 8192;
    static char sCommandBuffer[CMD_BUF_LEN];
    
    //- 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;