php - Preventing warnings from fsockopen -


i use fsockopen() connect multiple servers in loop.

however servers not valid , php warnings 1 below:

warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: requested name valid, no data of requested type found 

is there way prevent these warnings.

like checking whether server before trying fsockopen it?

or there or better solution this?

use error control operator , check results of fsockopen() verfiy have valid connection.

$rc = @fsockopen(...); if (is_resource($rc)) {    // work } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -