. */ namespace SP\Util; /** * Class ConnectionInterface * * @package SP\Util */ interface ConnectionInterface { const TYPE_TCP = 1; const TYPE_UDP = 2; const SOCKET_TIMEOUT = 10; /** * Obtener un socket * * @param $type * * @return resource */ public function getSocket(int $type); /** * Cerrar un socket * * @return mixed */ public function closeSocket(); /** * Obtener el último error del socket * * @return string */ public function getSocketError(): string; /** * Enviar un mensaje al socket * * @param $message string El mensaje a enviar * * @return mixed */ public function send(string $message); }