This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Sockets and Internet Protocols and the fly likes Hi Help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Hi Help me" Watch "Hi Help me" New topic
Author

Hi Help me

maha devan
Ranch Hand

Joined: Mar 16, 2004
Posts: 50
Hi I am beginner in sockets. PLs help me in this

I wrote a client code that reads a txt file and sends it to the server.The server code prints the file until it reaches EOF String.
I am getting all the stuffs printed out ,but em getting a exception like this


StartedServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8090]
Connection AcceptedSocket[addr=/127.0.0.1,port=1074,localport=8090]
Echoing Stringojhejwk
Echoing Stringqkodjsjd
Echoing Stringkoqsjdosa;
Closing
Exception in thread "main" java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at Serversocket.main(Serversocket.java:19)
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Welcome to the Ranch maha!

I might try to help if I could see the code, preferably properly indente, yes thank you.

Maybe you tried to close the socket while still a thread was blocked trying to read from it.


SCJP2. Please Indent your code using UBB Code
 
wood burning stoves
 
subject: Hi Help me