Communication protocol changed

Adding timeout to socket recv function. This is usefull for low network
connection quality.