Use the same code for Client, Socket and Server for Win/Linux