Socket Functions

(The material presented in this section can get rather technical. If you find it too complex, you may wish to skip to see how sockets really work with PHP. The codes for WebSocket can be downloaded at the official website of this book.)

Before a client can connect to the server over a socket connection, a listening socket needs to be set up first at the server’s end.