Socket engine refactoring

Refactored SocketEngine to reduce code duplication between different
platforms. All classes use disallow copy and assign macro