[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'out of range' error in FD_SET



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


That's an interesting dilemna. You're creating a new socket descriptor until you reach the maximum capacity of a descriptor set ("fdset").


I suppose I could increase the capacity of the descriptor set, but all that'd do is make it take a little longer to fail, it wouldn't solve the problem.

The question is, why aren't the sockets getting closed so that they can be reused? I'm going to have to see if I can duplicate the error so that I can try to trace the reason why things aren't getting cleaned up properly.

---
Scott Klement  http://www.scottklement.com

On Tue, 8 Nov 2005 jthompson@xxxxxxxxxxx wrote:

I have a program doing an ftp_list every 5 minutes, monitoring a remote
directory.

At about the same time every day, I get message " Length or start position
is out of range for the string operation." issued by procedure FD_SET.
The call stack looks like this:

ftp_list --> ftp_lstraw --> get_byline --> bufline --> fd_set.

The file descriptor passed to fd_set has a value of 224.

Just prior to the call to the line that fails - it's a %subst - there's a
call to proc CalcBitPos which returns a value of 32. It's this value of 32
that is being used as the starting position by the %subst on a field with
length of only 28 that's causing the error.



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------