EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: CAC: unable to create virtual circuit b/c "Too many open files"
From: "Bertrand H.J. Biritz" <[email protected]>
To: [email protected]
Date: Sat, 5 Jul 2008 22:13:19 -0400
Dear Tech-talk,

I wrote a monitoring program using some of the example code from EPICS- BASE and the lecture videos. It connects to an IOC every 5 minutes for 12 PV's and write their values to a text file.

The only problem is that it eventually fails with the following error message:

epicsSocketEnablePortUseForDatagramFanout: unable to set SO_REUSEADDR?
epicsSocketDestroy: failed to close a socket because "Bad file descriptor"
CAC: unable to create virtual circuit because "Too many open files"


the last line is repeated multiple times.

Now the relevant code snippet is:

while(1)
{
...
...
...
      /*
       * Here is where the CA calls happen
       */


/* Initialize */


 status=ca_context_create(ca_disable_preemptive_callback);
      if(status != ECA_NORMAL)
	{
	  printf("ca_context_create failed:\n%s\n",ca_message(status));
	  exit(1);
	}

/* Search */

for(i = 0; i < 12; i++)
{
status = ca_create_channel (pv[i],connectionChangedCB,NULL,CA_PRIORITY_DEFAULT,&pCh[i]);
if(status != ECA_NORMAL)
{
printf("ca_create_channel for pv%d failed:\n%s\n", i, ca_message(status));
exit(1);
}
}


      /* Wait */
      startTime=curTime;
      ca_pend_event(timeout);

/* Clear the channel */

for(i = 0; i < 12; i++)
{
status=ca_clear_channel(pCh[i]);
if(status != ECA_NORMAL)
{
printf("ca_clear_channel for pv%d failed:\n%s\n", i, ca_message(status));
}
}


/* Exit */

      ca_context_destroy();
...
...
...
}

I thought I had included everything I need, but apparently I missed something.

Any help would be greatly appreciated,
Bertrand

Happy post July 4th!
Replies:
RE: unable to create virtual circuit b/c "Too many open files" Mark Rivers

Navigate by Date:
Prev: Re: Epics DMA for the MVME6100 Andrew Johnson
Next: RE: unable to create virtual circuit b/c "Too many open files" Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: CAEN VME V1724 8 Channel 14 bit 100 MS/s Digitizer Rose, AJ (Austen)
Next: RE: unable to create virtual circuit b/c "Too many open files" Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·