mirror of
https://github.com/xPaw/PHP-Source-Query.git
synced 2026-05-18 13:53:35 +02:00
Make an abstract class for sockets and allow specifying different socket in SourceQuery
This is a preparation for tests
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Pavel Djundik <sourcequery@xpaw.me>
|
||||
*
|
||||
* @link https://xpaw.me
|
||||
* @link https://github.com/xPaw/PHP-Source-Query
|
||||
*
|
||||
* @license GNU Lesser General Public License, version 2.1
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
|
||||
namespace xPaw\SourceQuery;
|
||||
|
||||
/**
|
||||
* Base socket interface
|
||||
*
|
||||
* @package xPaw\SourceQuery
|
||||
*/
|
||||
abstract class BaseSocket
|
||||
{
|
||||
public $Socket;
|
||||
public $Engine;
|
||||
|
||||
public $Ip;
|
||||
public $Port;
|
||||
public $Timeout;
|
||||
|
||||
public function __destruct( )
|
||||
{
|
||||
$this->Close( );
|
||||
}
|
||||
|
||||
abstract public function Close( );
|
||||
abstract public function Open( $Ip, $Port, $Timeout, $Engine );
|
||||
abstract public function Write( $Header, $String = '' );
|
||||
abstract public function Read( $Length = 1400 );
|
||||
}
|
||||
Reference in New Issue
Block a user