zhaojh329 / libuwsc

A Lightweight and fully asynchronous WebSocket client library based on libev
MIT License
289 stars 55 forks source link

void pointer for char pointer in example.c #20

Closed andrewhodel closed 4 years ago

andrewhodel commented 4 years ago

https://github.com/zhaojh329/libuwsc/blob/master/example/example.c#L67

static void uwsc_onmessage(struct uwsc_client *cl,
    void *data, size_t len, bool binary)
{

Why is data a void pointer not a char pointer?

andrewhodel commented 4 years ago

Or a uint8_t or just a char?

I get this error now, that I have never seen before so I am going to see if it goes away with a void pointer.

writev(2, [{iov_base="(pgrmc:1440) onerror:"..., iov_len=46}, {iov_base=NULL, iov_len=0}], 2(pgrm.c:1440) onerror:1: read error

Also a dmesg entry:

do_page_fault(): sending SIGSEGV to pgrm for invalid write access to 00000000