Refactoring connection drivers
Refactored network code for Server side.
Refactored client side
Updated java server sample