Refactored socket recv/send interface
Socket cleanup