Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Read Object Throw java.io.EOFException  RSS feed

 
gi gie
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I write a Client/Server program,trying to send and receive a object between client and server.
I use the ObjectStream but there exists an EOFException on the client side when invoking readObject()
I've tried many times but couldn't figure it out.Can anybody help?

server-side code



client-side code

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try not closing the OOS in line 17. It will anyway be closed in line 30.
 
gi gie
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Try not closing the OOS in line 17. It will anyway be closed in line 30.


Thanks for your reply.
I close it,but didn't work!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I close it,but didn't work!

Maybe I'm misunderstanding what you're saying, but my advice was to not close it (meaning, delete line 17).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!