Re: [PATCH] allow non blocking http_receive_result

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

Arne K. Haaje schrieb:
> Alexander Malysh wrote:
>> Hi all,
>>
>> attached patch allows http_receive_result to be non blocking if 
>> requested. It allow us to start only one thread for http client side.
>>
>> any objections?
>>
>> Thanks,
>> Alex
>>
> 
> Hi Alex,
> 
> I don't have any objections (I'm not confident I understand the issue 
> well enough :D ), but I am interested in knowing what it is good for?

Ok, now we have w/o a patch only one possibility to use http client lib:

thread1:
	http_send

thread2:
	http_receive (in blocking mode)

W/ patch applied we can use lib as follows:

thread1:
	while(1)
		http_send
		count++

		if http_receive (non blocking)
			count--
		else if count > max_allowed_pending
			http_receive(blocking)


Basically we don't always need 2 threads anymore. we can reach the same 
throughput with only one.

> 
> I ask because of bugs 302 and 303 where the smsbox stops sending http 
> requests for incoming DLR and SMS'es. Will this have any impact with 
> regard to that issue?
> 

not this patch doesn't fix those issues and also not make it more badly.

Thanks,
Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.