Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send data & read the response continuously #42

Open
herusdianto opened this issue Feb 4, 2016 · 2 comments
Open

How to send data & read the response continuously #42

herusdianto opened this issue Feb 4, 2016 · 2 comments

Comments

@herusdianto
Copy link

Thankyou for this great library Sir.

I have some questions, here is my flow:

  1. I connect to server A via SSH.
  2. After connected, then I want to connect to server B using netcat with this command: netcat -q -1 host port.
  3. Then I send data to server B for log on (ISO 8583).
  4. I send data to server B for echo test (ISO 8583).
  5. I send data to server B continuously for financial transaction (ISO 8583).
  6. I want to read the response from server B everytime I send the ISO.

But it always throw an error like this:
java.lang.IllegalArgumentException: non-zero exit code #127: ISO0110000170800100000100010000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000204153211031510001 <= log on message

My terminal output:

heru@aaa:~$ netcat -q -1 host port
ISO0110000170800100000100010000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000204143453093937001 <<< request logon
ISO011000017081010000010001000000000000000000000000000100000000000000000000000000000010000000000000000000000000000000000000000000000000000000000020414345309393700001 <<< response logon

ISO0110000170800100000100010000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000204143559059307301 <<< request echo
ISO011000017081010000010001000000000000000000000000000100000000000000000000000000000010000000000000000000000000000000000000000000000000000000000020414355905930700301 <<< response echo

ISO011000017020001110010001110100100000000000001000010001000001110000000000000101600000000000000003000000000000000000204141138098412141138020402047010040916000000000000000000000000000000400000250239865570310000411612100360006000001      <<< request financial
ISO011000017020001110010001110100100000000000001000010001000001110000000000000101600000000000000003000000000000000000204141138098412141138020402047010040916000000000000000000000000000000400000250239865570310000411612100360006000001aaaaa <<< response financial

My question is, how to send and read the response from server B continuously using this library? Thankyou & sorry for my bad English.

@herusdianto herusdianto changed the title How To Keep SSH Alive How to send data & read the response continuously Feb 4, 2016
@dmarkov
Copy link

dmarkov commented Feb 8, 2016

@yegor256 dispatch this issue please, see par.21

@yegor256
Copy link
Member

yegor256 commented Feb 9, 2016

@herusdianto I think you just need to not close the InputStream and keep pushing data there. Also, don't close the OutputStream and keep reading from there. That should work, provided your server command don't quit and keeps running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants