base implementation of client-server comunication