modifies socket functionality, includes close and error