initialize sockets automatically