Socket override function