Skip to content

解决nlog,linux PC使用bash telnet访问log,按ctrl+c无法退出问题 #12

@mosxuqian

Description

@mosxuqian

static void on_read(hio_t* io, void* buf, int readbytes) {

代码修改成即可

static void on_read(hio_t* io, void* buf, int readbytes) {
printd("on_read fd=%d readbytes=%d\n", hio_fd(io), readbytes);
printd("< %s\n", (char*)buf);
uint8_t* tmp = buf;
if (readbytes > 4 && tmp[0] == 255 && tmp[1] == 244 && tmp[2] == 255 && tmp[3] == 253 && tmp[4] == 6)
{
hio_close(io);
}
}

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