You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rashmi R Katagall <ra...@in.ibm.com> on 2016/03/07 11:38:55 UTC

Tomcat 7.0.63 - socketBuffer "-1" - linux platform behaviour

Hi,

I have implemented a service using Http11Protocol and I have disabled the 
socketBuffer for the object by setting its value to "-1". When the client 
disconnects before the server responds, then on windows I see the 
exception:

SEVERE: Error processing request
java.net.SocketException: Unrecognized Windows Sockets error: 0: socket 
write er
ror
        at 
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:125)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:171)
        at 
org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffe
r.doWrite(InternalOutputBuffer.java:243)
        at 
org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(Identit
yOutputFilter.java:84)
        at 
org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputB
uffer.java:192)
        at org.apache.coyote.Response.doWrite(Response.java:499)
        at dummyAdapter.service(dummyAdapter.java:49)

But on linux, I don't see any exception raised.

The source code and jar file - 

To execute the code run: java TomcatCipherTst

This will start the listener on port 7677 and wait for client to connect. 
The server responds only after 60 seconds. So, to recreate the client 
needs to disconnect before 60 seconds.

I am looking for help to understand why there is no exception raised on 
linux when the client disconnects before server responds unlike that on 
windows.


Thanks,
Rashmi
 





Re: Tomcat 7.0.63 - socketBuffer "-1" - linux platform behaviour

Posted by Rashmi R Katagall <ra...@in.ibm.com>.
I realised my attachment didnt go through. Here is my source code:

My adapter service implementation looks like this:
public class dummyAdapter implements Adapter {
  public boolean asyncDispatch(Request arg0, Response arg1, SocketStatus 
arg2)
                                                 throws Exception {
                                                 return false;
                 }

                 public boolean event(Request arg0, Response arg1, 
SocketStatus arg2)
                                                 throws Exception {
                                 return false;
                 }

                 public String getDomain() {
                                 return null;
                 }

                 public void log(Request arg0, Response arg1, long arg2) {
 
                 }

                 public void service(Request req, Response res) throws 
Exception {
 
        System.out.println("We got em");
        Thread.sleep(60000);
 
                 String resp = new String("We got request for |" + 
req.requestURI().toString() + "|");
        ByteChunk bc = new ByteChunk();
        byte[] respBA = resp.getBytes("utf-8");
        bc.setBytes(respBA, 0, respBA.length);
        res.setContentLength(respBA.length);
        res.doWrite(bc);
        res.finish();
                 }

                 public void checkRecycled(Request arg0, Response arg1) {
 
                 }

                 public void errorDispatch(Request arg0, Response arg1) {
 
                 }
}

BrokerProtocolHandler is:
public class BrokerProtocolHandler extends 
org.apache.coyote.http11.Http11Protocol
{
    public BrokerProtocolHandler() {
        super();
    }
 
    public AbstractEndpoint getEndpoint() {
        return endpoint;
    }
}

Cheers,
Rashmi
 

Ms.Rashmi R.Katagall
IBM(ISL),
Rajiv Gandhi Infotech Pk, Phase 2
Hinjewadi, Pune.
Tel: 020-42026585 | Cell: 08380099916 | Email: rashmikatagall@in.ibm.com






From:   Rashmi R Katagall/India/IBM@IBMIN
To:     users@tomcat.apache.org
Date:   2016-03-07 04:58 PM
Subject:        Tomcat 7.0.63 - socketBuffer "-1" - linux platform 
behaviour



Hi,

I have implemented a service using Http11Protocol and I have disabled the 
socketBuffer for the object by setting its value to "-1". When the client 
disconnects before the server responds, then on windows I see the 
exception:

SEVERE: Error processing request
java.net.SocketException: Unrecognized Windows Sockets error: 0: socket 
write er
ror
       at 
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:125)
       at java.net.SocketOutputStream.write(SocketOutputStream.java:171)
       at 
org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffe
r.doWrite(InternalOutputBuffer.java:243)
       at 
org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(Identit
yOutputFilter.java:84)
       at 
org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputB
uffer.java:192)
       at org.apache.coyote.Response.doWrite(Response.java:499)
       at dummyAdapter.service(dummyAdapter.java:49)

But on linux, I don't see any exception raised.

The source code and jar file- 

To execute the code run: java TomcatCipherTst

This will start the listener on port 7677 and wait for client to connect. 
The server responds only after 60 seconds. So, to recreate the client 
needs to disconnect before 60 seconds.

I am looking for help to understand why there is no exception raised on 
linux when the client disconnects before server responds unlike that on 
windows.


Thanks,
Rashmi




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