First attempt at using Nonblocking synchronous sockets instead of async so that this code works in the web player