Dear Nic:
I got a problem. It's some sense off-topic, but the problem comes out from a
servlet
problem. Below is the problem:
In servlet A, I open a socket connection to host H, where there is a servlet
running as
a server program. And I send something to that servlet. In host H, the
servlet receive
the information sent by A and process it. After that, write something back
to A. Then
A read the information from it and close the connection.
I implemented it and sometime encountered some io problem. Someone told me,
I
should open two socket connections, one for writing to host H, the other one
for reading
from H. Is it right? Do I need to do that? Is my way of communication
correct?
Thanks for your consideration!
Regards
Liwen
----- Original Message -----
From: "Nic Ferrier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 15, 2000 11:27 PM
Subject: Re: is out.flush() or out.close() necessary ?
> >>> Mike Haberman <[EMAIL PROTECTED]> 15-May-00 3:55:27 PM >>>
>
> >In many of the "how to" books on servlets they never
> >mention what to do with do with the response's PrintWriter
> >after you are done writing to it. Should it be closed, or at least
>
> >flushed?
>
> You *shoiuld* close() it yourself... but servlet containers tend to
> do it for you to make sure.
>
> (but good code *should* do it).
>
>
> >Could this be because the output stream wasn't flushed ?
>
> could be.
>
>
>
> Nic Ferrier
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html