Article View: borland.public.jbuilder.java.language
Article #15456Problem serializing to socket
From: werwr21
Date: Mon, 14 Jun 1999 00:00
Date: Mon, 14 Jun 1999 00:00
28 lines
1508 bytes
1508 bytes
The following code compiles but blocks when run:
in = new DataInputStream(socket.getInputStream());
objIn = new ObjectInputStream(in);
It is part of an application which uses serialization to transmit objects
using sockets. The blocking occurs at the call of ObjectInputStream. Tracing
into the standard classes I found that the blocking actually occurs at a
call to socketRead in the read method of SocketInputStream.java, below:
public int read(byte b[], int off, int length) throws IOException {
if (eof) {
return -1;
}
int n = socketRead(b, off, length);
if (n <= 0) {
eof = true;
return -1;
}
return n;
}
I run the application on an NT machine. All other applications, using TCP/IP
services, funtion without a problem. In fact the problematic application has
worked in the past, using exactly the same code. Since the blocking happens
in standard code, no change of my code could have affected it.
Has anybody come across this kind of problem?
Technical Details
Message-ID:
<7k2kce$hnb6@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,b5b4a4535f33850c,start X-Google-Attributes: gidf74b3,public From: "werwr21" <asd@sdfs.com> Subject: Problem serializing to socket Date: 1999/06/14 Message-ID: <7k2kce$hnb6@forums.borland.com> X-Deja-AN: 489384219 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.language