Add socket functionality