7

The full error is:

java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:154)
    at java.io.BufferedReader.readLine(BufferedReader.java:317)
    at java.io.BufferedReader.readLine(BufferedReader.java:382)
    at chat.run(chat.java:76)
    at java.lang.Thread.run(Thread.java:722)

"at chat.run(chat.java:76)" is this line:

System.out.println("[_in_"+(line=ins.readLine())+"_]");

line being a string and ins being a BufferedReader

ins = new BufferedReader(new InputStreamReader(_sock.getInputStream()));

_sock being

Socket       _sock      = null;
_sock = serv_sock.accept();

This happends on my Server java and not on my client java... Also, this happends when I dont send anything for a little while

-----EDIT------

I tried it again; First it went 40 minutes of doing nothing and it still worked, then I waited 40 minutes again and this time it didn't work.

It seems to be kind of random.. I can't figure out what's causing it.

The files I have are * [client.java], [chat.java], [vlc.java] * [server.java], [chat.java], [vlc.java]

the vlc files are the same in both although chat is different (since I havn't done Threads in both client and server yet)

Here's the code;

   SERVER
server.java: pastebin.com/GH8ShcGp
chat.java  : pastebin.com/iaL23kSb
vlc.java   : pastebin.com/9kyrbh5q



    CLIENT
client.java: pastebin.com/HDK450Jg
chat.java  : pastebin.com/CfHrEUkE
vlc.java   : pastebin.com/SfZgYy58

I think it's a window/network thing. Someone who please can help me fix this??

4

3 Answers 3

5

I couldn't get your exact problem to replicate on my own computer using your code and localhost-connections, but after reading about "BufferedReader.readLine() throwing java.net.SocketException: Software caused connection abort: recv failed" in several different pages, I believe this is related to your network. The connection seems to be terminated due to TCP timeout or data corrupted in the transmission.

If this happens over localhost-connections (server and client in same computer), it could be a faulty memory, otherwise you might have a broken nic, router or cable somewhere along the line. If you're using wireless, they can be pretty unreliable.

Sign up to request clarification or add additional context in comments.

7 Comments

Added more info to the question
You modified the code (it gets port # etc from a properties file) and opened up 2 vlcs and went into Tools -> preferences -> Show settings: all -> Interface -> main interfaces -> rc -> check "do not open dos.." and type in 127.0.0.1:PORT_YOU_SET_IN_vlc.java in the "tcp command input"? (chose a different port in server and client and change accordingly in the tcp-command-input windows) - If you did that and it worked to pause and play - did you pause and let it sit for a while? Try 30+ minutes and see if it gives you the error then. Do other stuff while you wait the x minutes. Try 1-3 times.
I'm not familiar with VLC's networking, I commented out the vlc-related calls in the code. Also note that I do not have Windows-computers at home, only Linux, so they might behave completely differently. However, I still think that your exception is related to the network link going down unexpectedly (which might also be caused by the VLC doing something wacky), but further than that, I really don't know...
wiki.videolan.org/VLC_command-line_help lists multiple different timeout-options for VLC-networking, my best guess is that VLC will terminate the connection with TCP timeout after being paused for long enough. Unfortunately I don't think I can help you any further with this.
The exception wasn't vlc-related, though. It was the BufferedReader.readLine() that threw it
|
0

This error occurs exactly due to problem in network. It comes when connection with your database failed and and application is unable to retrieve the required data. The problem may be in your connection wire or with the modem. Try changing them. Otherwise check your database access in sql developer etc if its working fine, there could be a problem in transaction timeout.

Comments

-3

There are two possibilities:

  • The database is down, or
  • The database server's IP address duplicates an existing server's IP address on the network

1 Comment

The question is about the color of apple. You are trying to answer with the shape of apple.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.