Added Ref/Unref calls to prevent GC from destroying active sockets