I am a bit confused about your description how the flow of messages between client and server works. It seems like the client is trying to act as a server once the first request has been sent, which I would expect would confuse any standard HTTP server. Should the client not instead send a new request containing the heartbeat acknowledgement instead of a HTTP response?
Christian On Fri, Dec 10, 2010 at 8:31 PM, Zulfiqer Sekender <[email protected]> wrote: > Thanks a lot for the reply. We are using 2.0.7. Now I will install 2.0.9 and > will check if that version solves this problem. This client program is > communicating with open source http erlang mochiweb server. That server > should be fine as that server is doing that functionality (exchanging > heartbeat with another http client written in Java) properly. > Could anybody (who is here with more evhttp experience) please help me? > Any sort of help will be highly appreciated. > Thanks again. > > > > ________________________________ > From: Nick Mathewson <[email protected]> > To: [email protected] > Sent: Fri, December 10, 2010 3:02:56 PM > Subject: Re: [Libevent-users] How http client can send back message to > server? > > On Fri, Dec 10, 2010 at 12:18 PM, Zulfiqer Sekender <[email protected]> > wrote: >> Hi, >> >> I have to develop a simple http client which can communicate with a http >> server. The client is sending evhttp_make_request(). The server sends >> "HT:" >> heartbeat in response after certain time and when the client gets "HT:" >> each >> time it will send "HA:" as heartbeat acknowledgement. Transfering of "HT:" >> & >> "HA:" should go on. >> >> I developed the following client program. It gets "HT:" and tries to send >> back "HA:". But server never gets the "HA:". >> >> I will highly appreciate any help regarding this. Please, let me know what >> wrong I am doing and how to do it correctly. (Intentionally I left few >> commented out lines to show what else options I tried.) > > You didn't say what version of Libevent you are trying this with. > 2.0.9-rc fixes some evhttp bugs that might or might not be relevant to > you here. > > You might also want to post a small example of the server-side of this > code; otherwise it's not actually possible to test & run it. > > Failing that, your best bet is probably to look through the http.c > source code in Libevent to see what part of the code would need to > change to make this work for you. I'm not at all sure whether and to > what degree evhttp currently supports what you want to do. Anybody > else here with more evhttp experience want to chime in? > > yrs, > -- > Nick > *********************************************************************** > To unsubscribe, send an e-mail to [email protected] with > unsubscribe libevent-users in the body. > > *********************************************************************** To unsubscribe, send an e-mail to [email protected] with unsubscribe libevent-users in the body.
