You can use it inside a <img /> HTML field...
Else simply use fsockopen and change timeout value... Here is an example with IP 192.168.1.125 as server IP and port 29000 and timeout 2, change the values and put the code you want in OK and not good cases...