Socket multiplexing for use in restricted environments where only a small number of sockets can be opened