dseay - 2007-01-12

my in.read(buff,0,buff.length); blocks forever when there is nothing to read.

I expect to get some sort of timeout exception, much like when you do a read on an input stream from a standard java Socket. 

I do get an exception on the connect if i to a server that is down.

Here are the statements I'm using to setup the session:

      session = jSch.getSession(auth.getUserName(), auth.getIPAddress(), auth.getPort());
      session.setUserInfo(new SSHv2User(auth.getUserName(),auth.getPassword(),null));
      session.setProxy(null);
      Properties config = new Properties();
      config.put("compression.s2c", "none");
      config.put("compression.c2s", "none");
      session.setConfig(config);
      session.connect(auth.getTimeout());
      channel = session.openChannel("shell");
      in = new InputStreamReader(channel.getInputStream());
      out = channel.getOutputStream();
      channel.connect(auth.getTimeout());

I can then issue send and reads no problem however if I try and read when the session is at prompt and there is nothing to read i'd like it to timeout?

Am I missing something?

Thanks for any advice,
Darren
darren@pacific.net