I was wondering if there was any class for php that is like winsock.
Printable View
I was wondering if there was any class for php that is like winsock.
Yes there is...
http://www.google.co.uk/search?hl=en...G=Search&meta=
PHP Sockets are not as easy as winsock however, there are no events such as DataArrival.
PHP Sockets are best used for a socket client rather than a server (though is possible).
They have been around for a long time so there are plenty of examples out there if you have a search.
One other thing to note is if your using a free webhost, they tend to disable the use of PHP Sockets because of people using them for malicious purposes.
The fsockopen function can be used for simple two way TCP connections. It lacks the granularity of PHP sockets but makes up for it in its simplicity. ;)