tcp/udpsocket: update to the new socket API: close() replaced by shutdown().