Continue working on socket factory, minor improvements in RPCClient

Change-Id: I21a5135f09d2561cff6399ebce9188fe03e256a8