🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #850

Re: Stream closes the socket

#850
From: Owen Green
Date: Thu, 03 Oct 2002 13:13
36 lines
2191 bytes
"Alexei Akimov" <a_p_akimov@mtu-net.ru> wrote in message
news:3d9c31f5@newsgroups.borland.com...
> Here are the extracts of  my code:

<snip>

The freezing shouldn't have any bearing on the stream being open; in fact
the only place, IMO, you should be calling close on the streams at either
end is in a finally block - there's no reason to need to close it
mid-transaction, AFAICS.

Is the freeze occurring when you attempt to create the ObjectOutputStream or
when you try and flush the writer?

Have you verified that the Response class serializes ok?

What are you doing with respect to threading on the server?

Why aren't you producing stack traces of exceptions on the server side?

Finally:
      if (theResponse.Result != Response.RESULT_OK)
         throw new Exception(theResponse.ErrorMessage);
     }
     catch (Exception e){
       Result = false;
       System.err.println(e.getLocalizedMessage());
     }
     return Result;
   }

is basically using an exception for flow control, which is very naughty (and
expensive) , either throw the exception back out of the method for higher
level handling or just return false.

Owen
Technical Details
Message-ID: <3d9c4372$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail
References: <3d9af28d$1@newsgroups.borland.com> <3d9b43d4@newsgroups.borland.com> <3d9c31f5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,79dc1cae35190f2a,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-10-03 13:14:42 PST
From: "Owen Green" <owen@begonefoulmachine.kennulz.demon.co.uk>
Newsgroups: borland.public.jbuilder.java.api
References: <3d9af28d$1@newsgroups.borland.com> <3d9b43d4@newsgroups.borland.com> <3d9c31f5@newsgroups.borland.com>
Subject: Re: Stream closes the socket
Date: Thu, 3 Oct 2002 14:13:59 +0100
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 62.253.133.165
Message-ID: <3d9c4372$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1033651058 62.253.133.165 (3 Oct 2002 06:17:38 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-04!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail