/** * 初始化 * @return void */ public function __construct($buffer = null) { if ($buffer) { $data = self::decode($buffer); $this->body = $data['body']; unset($data['body']); $this->header = $data; } else { if (self::$seriesId >= 65535) { self::$seriesId = 0; } else { $this->header['series_id'] = self::$seriesId++; } } }