Internal/SocketFactory.php
public static function createServerSocket($socketAddress, $socketContext = null)
    {
        try {
            return self::doCreateServerSocket($socketAddress, $socketContext);
        } catch (Exception\BindOrListenException $e) {
            if (($socketFile = IdentificationHelper::getSocketFile($socketAddress)) !== null) {
                try {
                    fclose(self::createClientSocket($socketAddress, 1, $socketContext));
                    // Really in use
                    throw $e;
                } catch (Exception\ConnectException $e2) {
                    // False positive due to a residual socket file
                    unlink($socketFile);

                    return self::doCreateServerSocket($socketAddress, $socketContext);
                }
            } else {
                throw $e;
            }
        }
    }
public static function createServerSocket($socketAddress, $socketContext = null)
    {
        try {
            return self::doCreateServerSocket($socketAddress, $socketContext);
        } catch (Exception\BindOrListenException $e) {
            if (($socketFile = IdentificationHelper::getSocketFile($socketAddress)) !== null) {
                try {
                    fclose(self::createClientSocket($socketAddress, 1, $socketContext));
                    // Really in use
                    throw $e;
                } catch (Exception\ConnectException $e2) {
                    // False positive due to a residual socket file
                    unlink($socketFile);

                    return self::doCreateServerSocket($socketAddress, $socketContext);
                }
            } else {
                throw $e;
            }
        }
    }
@param string        $socketAddress
@param resource|null $socketContext

@throws Exception\BindOrListenException

@return resource