I have a windows desktop application that periodically (every ~10 seconds) queries a folder in a Unix machine to see if there are files there and if yes picks them up and does some processing.
My question is, should I open the connection once when the application starts and close the connection when its killed, or should I open and close the connection every time the application does a query.
I prefer to open and close each time as its easier to implement and carries less risk of having the application crash and leaving a connection open. On the other hand I don’t know what sort of overhead comes from opening / closing the connection.
I’d give the answer to mat but he chose to comment.