Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How does FTPeek_IsConnected work?

Featured Replies

I tried using this function to keep the connection active, but it seems it still gives me "1" even when the FTP server has disconnected. If I connect, then use this to check every 30s, then leave it for 10 minutes or so and then try uploading/downloading a file I get error as if I am no longer connected.

Is it actually checking with the FTP server?

If not using this function, any suggestions on how to keep the connection active (we are talking minutes, not hours)?

 

Hi Fabian,

Calling this function is not going to keep the connection active as it doesn't reach out to the server. What I did discover is that if the connection to the FTP server goes stale and the connection is closed by the FTP server rather than disconnecting from the client side, the FTPeek_IsConnected function will still return one. I have reported this as an issue to our issue tracking system but it may be something that is inherent in the FTP code library we are utilizing. What I recommend is rather than keeping the connection open where it could go stale, anytime you need to transfer/download a file: connect, do the transfer of the file, and disconnect. This will prevent the connection from being closed by the server and will eliminate the need for the IsConnected function. 

  • Author
11 hours ago, ryan360Works said:

What I did discover is that if the connection to the FTP server goes stale and the connection is closed by the FTP server rather than disconnecting from the client side, the FTPeek_IsConnected function will still return one. 

Yes, so I can't see any use at all for this function, as I would typically use it to check I'm still connected before I upload or change directory (I think this is from your sample file).

Quote

What I recommend is rather than keeping the connection open where it could go stale, anytime you need to transfer/download a file: connect, do the transfer of the file, and disconnect. This will prevent the connection from being closed by the server and will eliminate the need for the IsConnected function. 

Thanks for the suggestion. That is how I do it when the team sends a file from FM and then I show them a dialogue box to confirm if everything was ok. However, they doubt the file is actually on the supplier FTP server, and don't believe the desired folders have been created, so they skip using FM and use their FTP client ("Fetch") instead. Compliance is a challenge... ;)

I would like to show them the FTP directory much like the they see it in Fetch (actually I believe I need to do better...) and I have everything ready, except for this part. When they are in Fetch and get disconnected, Fetch will not tell them and will keep showing the directory, and if they click a folder it will reconnect seamlessly and open the folder. Same thing if they drop a file on the window, it will reconnect and upload.

The way they use Fetch, they might be "connected" for 15 minutes or so. I'm thinking that the easiest way to achieve a similar behaviour with FM/360 is to make sure the connection stays open. I was testing with FTPeek_GetCurrentDir (set to a variable, without using the result), and it looks like it might do the trick. Still, that is a workaround, so keep me informed if you fix the problem.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.