RE: [Libevent-users] Read callback problem

2011-02-08 Thread Kelly Brock
Ack, missed how the read was pulling the data off. Nice catch Nick... > > static void OnRead(struct bufferevent *bev, void *user_data) > > { > > int buf_len = evbuffer_get_length(bufferevent_get_input(bev)); > > ConnectionContext *ctx = user_data; > > uint8_t size_data[4],*data; > >

Re: [Libevent-users] Read callback problem

2011-02-07 Thread Gordiychuck Oleg
Thank you, exactly what i need ! :) *** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-usersin the body.

Re: [Libevent-users] Read callback problem

2011-02-07 Thread Nick Mathewson
2011/2/6 Gordiychuck Oleg : > > > Начало переадресованного сообщения: > > От: Gordiychuck Oleg > Дата: 7 лютого 2011 р. 00:04:43 GMT+02:00 > Кому: majord...@freehaven.net > Тема: Read callback problem > > Hello! > > I have a simple network application with simple protocol over TCP\IP. The > main i

Re: [Libevent-users] Read callback problem

2011-02-07 Thread Gordiychuck Oleg
Hello! My send function is next: static void WriteNeighbor(Neighbor *neighbor, unsigned int size, uint8_t *data) { uint8_t pre_data[4]; Utils::put_be32(pre_data, command); if (bufferevent_write(neighbor->bev,pre_data,4)==-1) ErrorFactory::Die(Errors::Write

RE: [Libevent-users] Read callback problem

2011-02-06 Thread Kelly Brock
Hi, > I have a simple network application with simple protocol over > TCP\IP. The main idea of protocol is size+message model. So at first i'm > sending size of message (coded in big-endian, first 4 bytes) than the > whole message. > I'm using event2 and read data from OnRead callback

[Libevent-users] Read callback problem

2011-02-06 Thread Gordiychuck Oleg
Начало переадресованного сообщения: > От: Gordiychuck Oleg > Дата: 7 лютого 2011 р. 00:04:43 GMT+02:00 > Кому: majord...@freehaven.net > Тема: Read callback problem > > Hello! > > I have a simple network application with simple protocol over TCP\IP. The > main idea of protocol is size+messag