12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/12/24
- * Time: 下午1:05
- */
- namespace room;
- use search\tcp_client;
- class access_client extends tcp_client
- {
- protected static $stInstance;
- public function __construct()
- {
- parent::__construct();
- $this->mBodyType = tcp_client::JsonType;
- }
- public static function instance()
- {
- if(self::$stInstance == null) {
- self::$stInstance = new factory_client();
- }
- return self::$stInstance;
- }
- public function __destruct()
- {
- parent::__destruct();
- }
- public function remote_addr()
- {
- global $config;
- $host = $config['room_srv']['host'];
- $port = $config['room_srv']['port'];
- return "tcp://{$host}:{$port}";
- }
- }
|