Code: Select all
<?php
//this will be a chat server
$hostname = "localhost";
$port = 8080;
$socket = socket_create(AF_INET, SOCK_STREAM, tcp); //create a socket
socket_bind($socket, $hostname, $port); //connect it to a computer
?>I'm not asking anyone to write this code for me, I want to learn for myself, but if someone could give me a pointer, an explanation, a function, or a link to a tutorial, I'll really appreciate it.
Another thing: I try running the above code on my windows box inside Zend, and it tells me that the functions are undefined. I'm running php 4.3.4. Help?
Thanks.