Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

closing server socket

 
Zonglin Li
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all:
Following Andrew�s book, when user try to exist from the server, it just exist the system (System.exit(0)) without closing the IO streams, client socket and server socket.

Although from the sample, there has the CleanExit class to protect the database, I still think it is still necessary close the server connections properly.

Do your guys think this is the right way to get better score for SCJD?

Any suggestions for this?

Thank you very much!
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the possibility to close a connection in the right way you should (off course) always do so.
 
Zonglin Li
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jethro
Thanks for your reply.
I am totally agreed with you.

Another reason for me raise this question is that I want to know why Andrew�s sample project doesn�t close the socket properly. I assume this is not difficult. Is it because I didn�t noticed the code which is in some where or it is not import for SCJD or it is just ignored by Andrew?

Thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic