Adding socket functionality