As mentioned in other answers, you should avoid socket communications if absolutely necessary. I would suggest XML as a communication data format instead of objects, as it allows you to easily communicate with clients working in other languages as needed, and it is much easier to debug them. XStream is a great library to facilitate the conversion of an ↔ xml object with minimal support code.
source
share