Error: Socket Exception while trying to access kmd

How can I implement this logic in the wallet itself, to be able to offer a multi wallet functionality and therefore derive multiple addresses from the same mnemonic without going through kmd?