is there a way to lock an agent socket ?