Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Swoole\Network; class EventUDP extends \Swoole\Server\Base implements \Swo..

Decoded Output download

<?php
namespace Swoole\Network;
class EventUDP extends \Swoole\Server\Base implements \Swoole\UDP_Server_Driver
{
    /**
     * Server Socket
     * @var unknown_type
     */
	public $server_sock;
	//
	public $max_connect=1000;

    //socket
	public $client_sock = array();
	//
	public $client_num = 0;
	public $buffer_size = 1028;
	public $flags = STREAM_OOB;

	function __construct($host,$port,$timeout=30)
	{
		parent::__construct($host,$port,$timeout=30);
	}
    /**
     * 
     * @return unknown_type
     */
	function run()
	{
	    //
		$this->init();
		//Socket
		$this->server_sock = $this->create("udp://{$this->host}:{$this->port}");

		//socket
		event_set($this->server_event,$this->server_sock, EV_READ | EV_PERSIST, "sw_server_handle_recvfrom",$this);
		event_base_set($this->server_event,$this->base_event);
		event_add($this->server_event);
		$this->protocol->onStart();
		event_base_loop($this->base_event);
	}
	/**
	 * 
	 * @return unknown_type
	 */
	function shutdown()
	{
	    //
	    sw_socket_close($this->server_sock,$this->server_event);
	    //
        event_base_loopexit($this->base_event);
        $this->protocol->onShutdown();
	}
}

function sw_server_handle_recvfrom($server_socket,$events,$server)
{
    $data = stream_socket_recvfrom($server_socket,$server->buffer_size,$server->flags, $peer);
    if($data !== false && $data !='')
	{
		$server->protocol->onData($peer,$data);
	}
} ?>

Did this file decode correctly?

Original Code

<?php
namespace Swoole\Network;
class EventUDP extends \Swoole\Server\Base implements \Swoole\UDP_Server_Driver
{
    /**
     * Server Socket
     * @var unknown_type
     */
	public $server_sock;
	//
	public $max_connect=1000;

    //socket
	public $client_sock = array();
	//
	public $client_num = 0;
	public $buffer_size = 1028;
	public $flags = STREAM_OOB;

	function __construct($host,$port,$timeout=30)
	{
		parent::__construct($host,$port,$timeout=30);
	}
    /**
     * 
     * @return unknown_type
     */
	function run()
	{
	    //
		$this->init();
		//Socket
		$this->server_sock = $this->create("udp://{$this->host}:{$this->port}");

		//socket
		event_set($this->server_event,$this->server_sock, EV_READ | EV_PERSIST, "sw_server_handle_recvfrom",$this);
		event_base_set($this->server_event,$this->base_event);
		event_add($this->server_event);
		$this->protocol->onStart();
		event_base_loop($this->base_event);
	}
	/**
	 * 
	 * @return unknown_type
	 */
	function shutdown()
	{
	    //
	    sw_socket_close($this->server_sock,$this->server_event);
	    //
        event_base_loopexit($this->base_event);
        $this->protocol->onShutdown();
	}
}

function sw_server_handle_recvfrom($server_socket,$events,$server)
{
    $data = stream_socket_recvfrom($server_socket,$server->buffer_size,$server->flags, $peer);
    if($data !== false && $data !='')
	{
		$server->protocol->onData($peer,$data);
	}
}

Function Calls

None

Variables

None

Stats

MD5 077968077e02fd992a4730f73742c9f1
Eval Count 0
Decode Time 96 ms