Development code for Sockets provider

- This is an incremental devel code for Sockets provider.

while loop is more naturally written as a for loop