implementing the socket connection as a service