ConnectDetach() problem (nto2)

Hello,I’m writing an application which use 2 connections on a channel for 2
timers sending a pulse when fire.

My code is (shortly):

while I want
{
chid = ChannelCreate(0);
ConnectAttach(ND_LOCAL_NODE, 0, chid, _NTO_SIDE_CHANNEL, 0); Create_timer();
ConnectAttach(ND_LOCAL_NODE, 0, chid, _NTO_SIDE_CHANNEL, 0); Create_timer();

… something to do;

timer_delete()
ConnectDetach()
timer_delete()
ConnectDetach()
ChannelDestroy()
}

The problem is that if, according psin, I only have 2 connections while the
application is running, their ID value is increasing until the application
exit with the following message: too many open files which seems to mean that
there is no more FD available.

What is the problem with my ConnectDetach()

Thanks, Alain.


Sent via Deja.com http://www.deja.com/
Before you buy.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

Hello,I’m writing an application which use 2 connections on a channel for 2
timers sending a pulse when fire.

First note – you don’t need two seperate connections for the two
timers, all the timers can use the same connection – just have
them send you different pulses. (That is a different pulse code
or pulse data.)

My code is (shortly):

while I want
{
chid = ChannelCreate(0);
ConnectAttach(ND_LOCAL_NODE, 0, chid, _NTO_SIDE_CHANNEL, 0); Create_timer();
ConnectAttach(ND_LOCAL_NODE, 0, chid, _NTO_SIDE_CHANNEL, 0); Create_timer();

… something to do;

timer_delete()
ConnectDetach()
timer_delete()
ConnectDetach()
ChannelDestroy()
}

The problem is that if, according psin, I only have 2 connections while the
application is running, their ID value is increasing until the application
exit with the following message: too many open files which seems to mean that
there is no more FD available.

There isn’t enough detail in what you’ve posted to guess at what might or
might not have gone wrong. ConnectAttach() returns a coid, how are these
saved/passed around? What does Create_timer() actually do?

-David