change socket to handle pings both client and server side