moved functions from implementation to server to allow implementing tcp server
Moved TCP server to AbstractServer implementation