You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by alexis <al...@gmail.com> on 2011/06/16 23:36:55 UTC

OT: about readers

Hello, all, i know this one is OT but i cannot figure it out how to do this


im reading from a socket with a bufferedreader using readLine, it works perfect, problem is some messages has no termination at all, so readLine never completes. 

How can i deal with this? i know i can read char by char building a string and matching on what i need, but i dont think that as a good solution.

Any help will be appreciated.

best regards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: OT: about readers

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexis,

On 6/16/2011 5:36 PM, alexis wrote:
> im reading from a socket with a bufferedreader using readLine, it
> works perfect, problem is some messages has no termination at all, so
> readLine never completes.

Do you mean that you are hitting the end of the input, but there's no
EOF, so you wait forever? That's expected behavior.

Reader.readLine should return something when a (environment-specific)
newline is read or EOF. Is that not what you're experiencing?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk36gKoACgkQ9CaO5/Lv0PAs8ACeMsC+zJ0gNyuWz8TkBf698Rpc
UZ8AnRwM0D6FIpeHP1WRx2ZCcpopI7s8
=1H8R
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: OT: about readers

Posted by Martin Gainty <mg...@hotmail.com>.
if bufferedReader doesnt give you what you need click package and you will see other readers including 
http://download.oracle.com/javase/1.4.2/docs/api/java/io/CharArrayReader.html

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> From: alzrck@gmail.com
> Subject: OT: about readers
> Date: Thu, 16 Jun 2011 18:36:55 -0300
> To: users@tomcat.apache.org
> 
> Hello, all, i know this one is OT but i cannot figure it out how to do this
> 
> 
> im reading from a socket with a bufferedreader using readLine, it works perfect, problem is some messages has no termination at all, so readLine never completes. 
> 
> How can i deal with this? i know i can read char by char building a string and matching on what i need, but i dont think that as a good solution.
> 
> Any help will be appreciated.
> 
> best regards
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>