use sockets instead of io