Potresti anche provare con fsockopen