Is there a work around to an InputStream.read block when no data is available?

Is there a work around to an InputStream.read block when no data is available?
scottd78Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Use non-blocking io
0
CEHJCommented:
What exactly is it you're doing?
0
scottd78Author Commented:
can you give me more detail on how to use non-blocking io?

I'm sending ftp commands over a socket using inputstreams and reading the server output.  Running into issues when something goes wrong with the FTP server and it doesn't respond.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

kiranhkCommented:
check this out for Non-blocking IO API

http://www.eecs.harvard.edu/~mdw/proj/java-nbio/
0
CEHJCommented:
It's more likely that the fault is with what you're sending the server. Once you've connected successfully, there is seldom much reason that anything will 'go wrong' on the server side such that you're going to get a blocked read. Can you be more specific about when this is happening?
0
scottd78Author Commented:
The ls command on the server can be deleted by people who have to have access to it, so if that gets deleted and I try to LIST, the server hangs.
0
CEHJCommented:
>>The ls command on the server can be deleted by people

How? The ls command is integral to ftp and the os
0
scottd78Author Commented:
I'm not very familiar with how they have the FTP setup but this is what I do know.  Each FTP users root directory has a /bin directory that includes their own ls binary.  I'm guessing they don't want to give permissions to the /bin/ls command for security reasons.
0
CEHJCommented:
Why would they allow access to a directory by ftp then refuse to list it? However this is being done, (a file permission blunder disallowing listing is also possible) then you should do the same - disallow the use of the list command by your program
0
scottd78Author Commented:
They don't disallow listing ... its when someone deletes that ls command I have a problem.  I need to do an ls to verify the complete file has been transferred sucessfully.
0
CEHJCommented:
If that's what they've done, then there's nothing you can do to list it. You could download it again and compare it to what you uploaded to be certain
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
8-)
0
scottd78Author Commented:
I hope no one yells at me now!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.