added socket functionality.