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

Re: 'out of range' error in FD_SET



Hi Loek,

The problem, if I understand it correctly, is caused by calling 
FTP_open() or FTP_Conn() but never calling FTP_quit() to close the session.

Using FD_CLEAR wouldn't help.



l.maartens wrote:
> Hi Scott,
> 
> I recently ran into this situation where I recieved the Message "Length or
> start position is out of range for the string operation".
> 
> As already determined this occurs when running FTPAPI within the same job
> for more then 254 times. The job is during the day repeatedly polling a FTP
> server in standard mode.
> 
> Your response then was that while enlarging the capacity of the descriptor
> set was the easy solution, the proper solution should be to ensure that the
> descriptors are closed, so they can be available for reuse.
> 
> Upon checking the archives and looking into the HTTPAPI and FTPAPI source
> code I think the situation still is as when this error was previously
> reported.
> 
> How can I determine that a file descriptor can be closed using FD_CLEAR, and
> how and when should I then be using FD_ISSET to determine if a FD is
> available?
> 
> Kind regards,
> 
> Loek Maartens,
> Veracity Software Consultancy BV
> 
> 
> ----- Original Message ----- 
> From: "Scott Klement" <sk@xxxxxxxxxxxxxxxx>
> To: <ftpapi@xxxxxxxxxxxxx>
> Sent: 08 November, 2005 06:37
> Subject: Re: 'out of range' error in FD_SET
> 
> 
>> Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
>>
>>
>>>> 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.
>> I forgot to ask...  are you using passive mode FTP?  Or standard?

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------