basic socket functionality