Have you looked at my socket client at www.think400.dk/downloads.htm? A
socket client already wiritten, just open read, write and close.

On Mon, Mar 12, 2012 at 3:30 AM, Berto Gil <berto.gil@xxxxxxxxx> wrote:

Good morning.
I am creating a client socket and do not manage to read the
inputStreamReader.

Even the line "Eval String3 = readIb(ib)" works perfectly.

Some solution?? Thank you.

IBUFFERED
d newBUFFERED PR O ExtProc(*JAVA:
d 'java.io.BufferedReader':
d *CONSTRUCTOR)
d
Class(*JAVA:'java.io.BufferedReader')
d ib O
d Class(*JAVA:'java.io.Reader')
**********************************************************************
d readIb PR O ExtProc(*JAVA:
d 'java.io.BufferedReader':
d 'read')
d Class(*JAVA:'java.lang.String')
**********************************************************************
d readIbLine PR O ExtProc(*JAVA:
d 'java.io.BufferedReader':
d 'readLine')
d Class(*JAVA:'java.lang.String')
**********************************************************************
d closeIB PR ExtProc(*JAVA:
d 'java.io.BufferedReader':
d 'close')

*********************************************************************



PROGRAM

h DftActGrp(*NO) ActGrp(*CALLER)
h thread(*serialize)
/Copy *libl/QRPGLESRC,MATHPR
/Copy *libl/QRPGLESRC,SOCKPR
/Copy *libl/QRPGLESRC,OSTREAMPR
/Copy *libl/QRPGLESRC,ISTREAMPR
/Copy *libl/QRPGLESRC,IBUFFERED
/Copy *libl/QRPGLESRC,ISTREAMBF
d IPadr c Const('10.232.1.40')
d Messa c Const('253')
d Port s 10I 0
*
d tmpIS s O
d
Class(*JAVA:'java.io.InputStream')
d tmpISR s O
d Class(*JAVA:'java.io.Input +
d
StreamReader')
d tmpOS s O
d
Class(*JAVA:'java.io.OutputStream')
d tmpBR s O
d
Class(*JAVA:'java.io.BufferedReader')
d string1 s O
d Class(*JAVA:'java.lang.String')
d string2 s O
d Class(*JAVA:'java.lang.String')
d string3 s O
d Class(*JAVA:'java.lang.String')
d Byte0 s O
d Class(*JAVA:'java.lang.Byte')
d Byte1 s O
d Class(*JAVA:'java.lang.Byte')
d Byte2 s O
d Class(*JAVA:'java.lang.Byte')
d ByteSend s O
d Class(*JAVA:'java.lang.Byte')
d Sum s O
d
Class(*JAVA:'java.math.BigDecimal')
d BigD1 s O
d
Class(*JAVA:'java.math.BigDecimal')
d BigD2 s O
d
Class(*JAVA:'java.math.BigDecimal')
d StringSum s O
d Class(*JAVA:'java.lang.String')
d Integer s O
d Class(*JAVA:'java.lang.Integer')
d Char s O
d
Class(*JAVA:'java.lang.Character')
d Display s 30A Varying
****************************
d Sock1 s O
d Class(*JAVA:'java.net.Socket')
*
d is s O Class(*JAVA:
d 'java.io.InputDataStream')
*
d ids s O Class(*JAVA:
d 'java.io.InputDataStream')
*
d os s O Class(*JAVA:
d 'java.io.OutputDataStream')
*
d ir s O Class(*JAVA:
d 'java.io.BufferedReader')
*
d ib s O Class(*JAVA:
d 'java.io.Reader')
*
d isb s O Class(*JAVA:
d 'java.io.InputStreamReader')
*
****************************
c Eval String1 = newString(IPadr)
c Eval String2 = newString(Messa)
c Z-add 10001 Port
c Eval Sock1 = newSocket(String1 : Port)
c* Eval Display = getBytes(String2)
*
*/free
* monitor;
* tmpOS=getOutput(Sock1);
* tmpBR=getInput(Sock1);
* os=newOSTREAM(tmpOS);
* writeBytes(os : String2);
* ib=newINSTREAMBF(tmpBR);
* ir=newBUFFERED(ib);
* on-error *all;
* endmon;
*/end-free
*
c* Display Dsply
*
c Eval tmpOS=getOutput(Sock1)
c Eval tmpIS=getInput(Sock1)
c Eval os=newOSTREAM(tmpOS)
c CallP writeBytes(os : String2)
c Eval isb=newINSTREAMBF(tmpIS)
c Eval ib=newBUFFERED(isb)
*
c Eval String3 = readIb(ib)
c Eval Display = getBytes(String3)
c Display Dsply
*
c CallP closeOS(os)
c CallP closeIB(ib)
c CallP closeSocket(Sock1)
c Eval *InLr = *On
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing
list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.