Improve connection between server e client

This commit improve the communication between server and client

Signed-off-by: José Guilherme Vanz <guilherme.sft@gmail.com>