Added support of socket use (finalizing now)