PHP
<?php
namespace System;
class Mus {
private $connection = [];
public function __construct($data = []) {
$this->connection = $data;
$this->sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname("tcp"));
@socket_connect($this->sock, $this->connection[0], intval($this->connection[1]));
}
public function __destruct() {
socket_close($this->sock);
}
public function send($header, $data = null) {
$data = $header . chr(1) . $data;
if(@socket_send($this->sock, $data, strlen($data), MSG_DONTROUTE)) {
return true;
}
}
}
$mus = new \System\Mus($data = ["127.0.0.1", 30001]);
$mus->send("ha", "Ich bin Giletabdi amina koyim. Ich rasiere euch mit Alerts amina koyim!");
?>
Alles anzeigen