add socket function
with socket c/h