Skip to content

unpack(): Type V: not enough input, need 4, have 0 #35

@UndercoverNL

Description

@UndercoverNL

I am using this code on a Laravel based system

        $rcon = new Rcon('ip, port, 'password', 1);
        if ($rcon->connect())
        {
            Log::info('connected');
            $rcon->sendCommand("say Hello World!");
        } else {
            Log::info('disconected');
        }

but if ($rcon->connect()) returns me the error unpack(): Type V: not enough input, need 4, have 0
which comes from

        $size_data = fread($this->socket, 4);
        $size_pack = unpack('V1size', $size_data);

But when I log all the variables inside the vendor src file, it does log the right info provided in the new Rcon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions