moving socket utils to public interface