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 BlockTCP extends \Swoole\Server\Base { public $ser..
Decoded Output download
<?php
namespace Swoole\Network;
class BlockTCP extends \Swoole\Server\Base
{
public $server_sock;
public $server_socket_id;
public $client_sock;
public $buffer_size = 8192;
public $timeout_micro = 1000;
function __construct($host, $port, $timeout=30)
{
parent::__construct($host,$port,$timeout);
}
/**
* client
* @param $client_id
* @param $data
* @return unknown_type
*/
function send($client_id,$data)
{
$this->sendData($this->client_sock[$client_id], $data);
}
function shutdown()
{
//
foreach($this->client_sock as $k=>$sock)
{
Stream::close($sock, $this->client_event[$k]);
}
//
Stream::close($this->server_sock, $this->server_event);
$this->protocol->onShutdown($this);
}
function close($client_id)
{
Stream::close($this->client_sock[$client_id]);
$this->client_sock[$client_id] = null;
unset($this->client_sock[$client_id]);
$this->protocol->onClose($this, $client_id, 0);
}
function server_loop()
{
while($this->client_sock[0] = stream_socket_accept($this->server_sock, -1))
{
stream_set_blocking($this->client_sock[0], 1);
if(feof($this->client_sock[0])) $this->close(0);
//Server
$data = Stream::read($this->client_sock[0],$this->buffer_size);
$this->protocol->onReceive($this, 0, 0, $data);
}
}
function connection_info($fd)
{
$peername = stream_socket_get_name($this->client_sock[$fd], true);
list($ip, $port) = explode(':', $peername);
return array('remote_port' => $port, 'remote_ip' => $ip);
}
function run($setting)
{
//Socket
$this->server_sock = $this->create("tcp://{$this->host}:{$this->port}");
stream_set_timeout($this->server_sock, $this->timeout);
$this->server_socket_id = (int)$this->server_sock;
stream_set_blocking($this->server_sock, 1);
$this->spawn($setting);
$this->protocol->onStart($this);
$this->server_loop();
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Swoole\Network;
class BlockTCP extends \Swoole\Server\Base
{
public $server_sock;
public $server_socket_id;
public $client_sock;
public $buffer_size = 8192;
public $timeout_micro = 1000;
function __construct($host, $port, $timeout=30)
{
parent::__construct($host,$port,$timeout);
}
/**
* client
* @param $client_id
* @param $data
* @return unknown_type
*/
function send($client_id,$data)
{
$this->sendData($this->client_sock[$client_id], $data);
}
function shutdown()
{
//
foreach($this->client_sock as $k=>$sock)
{
Stream::close($sock, $this->client_event[$k]);
}
//
Stream::close($this->server_sock, $this->server_event);
$this->protocol->onShutdown($this);
}
function close($client_id)
{
Stream::close($this->client_sock[$client_id]);
$this->client_sock[$client_id] = null;
unset($this->client_sock[$client_id]);
$this->protocol->onClose($this, $client_id, 0);
}
function server_loop()
{
while($this->client_sock[0] = stream_socket_accept($this->server_sock, -1))
{
stream_set_blocking($this->client_sock[0], 1);
if(feof($this->client_sock[0])) $this->close(0);
//Server
$data = Stream::read($this->client_sock[0],$this->buffer_size);
$this->protocol->onReceive($this, 0, 0, $data);
}
}
function connection_info($fd)
{
$peername = stream_socket_get_name($this->client_sock[$fd], true);
list($ip, $port) = explode(':', $peername);
return array('remote_port' => $port, 'remote_ip' => $ip);
}
function run($setting)
{
//Socket
$this->server_sock = $this->create("tcp://{$this->host}:{$this->port}");
stream_set_timeout($this->server_sock, $this->timeout);
$this->server_socket_id = (int)$this->server_sock;
stream_set_blocking($this->server_sock, 1);
$this->spawn($setting);
$this->protocol->onStart($this);
$this->server_loop();
}
}
Function Calls
None |
Stats
MD5 | c114f0fdd925feeb49f7785e371eca35 |
Eval Count | 0 |
Decode Time | 101 ms |