terrible java.net.SocketException: Broken pipe, please HELP!!

Discussion in 'Java' started by Tomas Penc, Oct 23, 2003.

  1. Tomas Penc

    Tomas Penc Guest

    Hi folks,

    lot of days we have problems with SocketException, thrown once per
    several hours on our TCP connection (thrown in client socket) and cannot
    overcome it. :-((( We already tried to find something elsewhere on web,
    but it never worked out. So, please help, if you can...

    We have a Socket connected over TCP and 2 threads: one reads constantly
    from the socket (blocking read), one writes data time to time. The
    application runs on Tomcat4.1 under Linux, Java 1.4.1. Once per several
    hours the following exception is thrown while writing to socket:

    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at
    java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at
    java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
    at
    java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
    ....

    (We also tried it without BufferedOutputStream.)

    We will be thankful for every useful comment.

    regards,
    Tomas Penc
     
    Tomas Penc, Oct 23, 2003
    #1
    1. Advertising

  2. "Tomas Penc" <> wrote in message
    news:bn8abd$i13$...
    > Hi folks,
    >
    > lot of days we have problems with SocketException, thrown once per
    > several hours on our TCP connection (thrown in client socket) and cannot
    > overcome it. :-((( We already tried to find something elsewhere on web,
    > but it never worked out. So, please help, if you can...
    >
    > We have a Socket connected over TCP and 2 threads: one reads constantly
    > from the socket (blocking read), one writes data time to time. The
    > application runs on Tomcat4.1 under Linux, Java 1.4.1. Once per several
    > hours the following exception is thrown while writing to socket:
    >
    > java.net.SocketException: Broken pipe
    > at java.net.SocketOutputStream.socketWrite0(Native Method)
    > at
    > java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    > at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    > at
    > java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
    > at
    > java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
    > ...
    >
    > (We also tried it without BufferedOutputStream.)
    >
    > We will be thankful for every useful comment.


    Is the socket in use the entire time? Sockets will timeout and disconnect by
    themselves when idle after about 2 hours.

    Cheers,
    Matt Humphrey http://www.iviz.com/
     
    Matt Humphrey, Oct 23, 2003
    #2
    1. Advertising

  3. Tomas Penc

    Tomas Penc Guest

    Matt Humphrey wrote:
    > Is the socket in use the entire time? Sockets will timeout and disconnect by
    > themselves when idle after about 2 hours.


    Yes, there is usually lot of traffic and we are also sending keep-alives
    every couple of minutes.

    regards,
    Tomas
     
    Tomas Penc, Oct 23, 2003
    #3
  4. Tomas Penc

    EJP Guest

    If you get this you have to assume that the target has closed the socket
    prematurely and react accordingly. Whether this is actually true is
    another matter, it can be an artefact of transient network conditions,
    but the effect is the same.

    Tomas Penc wrote:
    >
    > Hi folks,
    >
    > lot of days we have problems with SocketException, thrown once per
    > several hours on our TCP connection (thrown in client socket) and cannot
    > overcome it. :-((( We already tried to find something elsewhere on web,
    > but it never worked out. So, please help, if you can...
    >
    > We have a Socket connected over TCP and 2 threads: one reads constantly
    > from the socket (blocking read), one writes data time to time. The
    > application runs on Tomcat4.1 under Linux, Java 1.4.1. Once per several
    > hours the following exception is thrown while writing to socket:
    >
    > java.net.SocketException: Broken pipe
    > at java.net.SocketOutputStream.socketWrite0(Native Method)
    > at
    > java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    > at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    > at
    > java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
    > at
    > java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
    > ...
    >
    > (We also tried it without BufferedOutputStream.)
    >
    > We will be thankful for every useful comment.
    >
    > regards,
    > Tomas Penc
     
    EJP, Oct 24, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bigbinc
    Replies:
    1
    Views:
    692
    Sudsy
    Dec 2, 2003
  2. Jeff
    Replies:
    9
    Views:
    4,504
    John C. Bollinger
    Nov 5, 2004
  3. ckumar
    Replies:
    4
    Views:
    42,005
    ckumar
    Feb 24, 2005
  4. Stefan Weber
    Replies:
    4
    Views:
    10,003
    Chris Uppal
    Aug 21, 2006
  5. Sreenath k

    Error 32 - Broken Pipe . Please Help!!

    Sreenath k, Sep 4, 2012, in forum: Python
    Replies:
    5
    Views:
    529
    Mark Lawrence
    Sep 5, 2012
Loading...

Share This Page