----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Remember, the client-connection you are writing to is not directly held by
your applet client, but
by Apache, which performs some buffering of data received from JServ and
written to each client.
Your application probably worked in JWS because in that case the servlet
engine and the web-
server are one thing, and the servlet was able to directly write to the
client's socket.
I don't know what your network configuration is like, if this is an
intranet, internet, inside-firewall,
cross-firewall app or what, but I would suggest something like an RMI
approach for your app.
The general scheme is that the applet calls the servlet to initialize; the
servlet creates an
RMI server and sends back enough info for the client to connect to the new
RMI object. I
don't have code details near to hand, but this kind of approach would give
you a "direct"
connection between your applet and your server-side code.
- Fernando
|--------+----------------------------------------->
| | David Briggs |
| | <[EMAIL PROTECTED]> |
| | Sent by: |
| | <[EMAIL PROTECTED]|
| | -dogs.com> |
| | |
| | |
| | 10/16/2000 07:50 AM |
| | Please respond to "Java Apache |
| | Users" |
| | |
|--------+----------------------------------------->
>------------------------------------------------------------------------------------------------------------|
|
|
| To: 'Java Apache Users' <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: RE: JServ's big packets
|
>------------------------------------------------------------------------------------------------------------|
----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Here's a quick sample of the relevant code which I'm pretty sure is OK.
As you can see, I do flush the stream out to the client.
// Input stream from Server application
is = ServerSocketConnection.getInputStream();
s_in = new ObjectInputStream(is);
// Output stream to Client Applet
oc = res.getOutputStream();
c_out = new ObjectOutputStream(oc);
Object server_in = null;
while (listening) {
try {
server_in = s_in.readObject();
}
catch (ClassNotFoundException cnfe) {
listening = false;
}
catch (IOException iocw) {
listening = false;
}
if (server_in instanceof DataUpdateEvent) {
try {
c_out.writeObject((DataUpdateEvent) server_in);
c_out.flush();
}
catch (IOException ioe) {
listening = false;
}
}
} // while
-----Original Message-----
From: Andras Balogh [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 1:15 PM
To: Java Apache Users
Subject: Re: JServ's big packets
----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hi,
Have You tried flush() -ing the Object Stream ??
Best wishes,
Andras.
----- Original Message -----
From: "David Briggs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 16, 2000 12:58 PM
Subject: JServ's big packets
>
> I have a servlet that is called by an applet. The servlet then makes a
> socket connection to a server program which feeds the servlet price
data
> as and when it becomes available. The servlet then sends this data
back
> to the applet via an Object Stream. Initially, I developed this
> application using the Sun JSWDK test engine and it worked fine (until
I
> started adding more users and the engine couldn't cope). JServ however
> only sends the data back to the applet once it totals approx 4.2k -
> which is about 65 data updates worth! I need the data updates to go
> straight to the client when the servlet receives them. The servlet is
> receiving the data correctly, and seems to be writing it to the output
> stream to the client correctly. However the data isn't leaving the
> machine until it reaches the magic 4.2k mark (approx 2 and a half HTTP
> packets). Is it JServ or the Apache Web Server that might be causing
> this, and which ever it is, does anyone have any idea how I can fix it
> to suit my situation? I've looked through all the conf and properties
> files for both programs and have the latest versions.
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]