basic socket library class (based on 9m)