As discussed in comments the problem is not in the code but in lack of connectivity. A firewall in the particular case.
To more easily debug the issue there are two approaches:
- remove the
@
that is suppressing warning/error output from thefsockopen
- inspect the values of
$this->errno
and$this->errstr
after the call failed