Replace hardcoded socket interfaces with dynamic once

Change-Id: I5e240cd063366f85c21f8a104e71f9b683c8ba20