The php Function Socket_Strerror
Socket programming is a way to create a two-way communication between a client and server. In order to do so, one has to use the socket class methods. The first thing to do is to create a socket using the socket_create function. Then, it has to be bound to an IP address and a port number. Once this is done, the client can send messages to the server and receive a reply. The error information can be retrieved by using the socket_last_error and socket_strerror functions.
The php function socket_strerror takes the errno value returned by socket_last_error and converts it to a human-readable error message, if available. It's useful for those who need to debug their socket programs. It's important to remember that system messages will appear differently depending on the current locale (LC_MESSAGES).
There is a good amount of tutorial and reference material online regarding socket programming in C, which can be applied with some tweaking to PHP. The UNIX Socket FAQ is a particularly good place to start for those unfamiliar with the topic. Once you have a grasp of the basics, you can move on to working with the stream extension. The most important functions for this are those that start with stream_socket_, such as fgets, fread and stream_get_contents. Using these functions, you can work with streams in a much more convenient fashion than with the socket extension. This is because they provide the underlying abstraction of the sockets API in a very simple and easy-to-use manner.