[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] TCP client not calling writecb



On 04/21/13 01:14, Nir Soffer wrote:
[---]
>>  bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);
>>  bufferevent_setcb(bev, readcb, writecb, eventcb, &ls);
> 
> You don't need to register the writecb - use NULL

   Ah, I think I realized what my error in reasoning was. I was thinking
of the callbacks in term of kqueue. But that's exactly the point with
bufferevents (I think?); that the actual write callbacks are hidden
within the library, and the application just adds data to the buffers
and lets libevent handle the "mess" of actually pushing the data to the
socket.

   I was under the impression that write callbacks with bufferevents
were just like those one uses with kqueue, but with the added bonus that
one could buffer up some data as well. Now that I think about it, such a
hybrid solution would be difficult to do and I can't really understand
what I didn't realize it yesterday. :)

-- 
Kind regards,
Jan Danielsson

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.