Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

:confused: Hello :
The MAX Sockets is 6 in the handset.
using IWeb, send 7 Http get request at the same time,
only last six request can be responsed, the first was ignored;
is there something additional I need to do to resume the connection??

the version is Brew3.15

//Following code is including in WebOpts
awo[i].nId = WEBOPT_FLAGS;
awo[i].pVal = (void *)WEBREQUEST_FORCENEWCONN;
i++;

Please give me some advices, best wishes!

Please show me a way!

Please show me a way!

Hey
I think you should use ISocket instead IWeb, because IWeb wrapped the socket. You can't control the socket directly.
So try ISocket, open 6 sockets and use each socket to send a special request.

Hey
I think you should use ISocket instead IWeb, because IWeb wrapped the socket. You can't control the socket directly.
So try ISocket, open 6 sockets and use each socket to send a special request.

Thank you for the reply;
if using ISocket, I have to process the Http, whice is what I want to ignore;
By debug, I find that the problem is emphasised in release the socket;
Though the 6 http request were finished, the sockets in handset are still occupyed. so the 7th Http request will return 1289 error when create the connection.
Can you tell me how can release the device socket after the Http request ?

Thank you for the reply;
if using ISocket, I have to process the Http, whice is what I want to ignore;
By debug, I find that the problem is emphasised in release the socket;
Though the 6 http request were finished, the sockets in handset are still occupyed. so the 7th Http request will return 1289 error when create the connection.
Can you tell me how can release the device socket after the Http request ?

That's the problem, if you use IWeb, you can 't access socket, so you can't release any socket. But after a http request, the connection will be broken by server, I guess you send the 7th request within the network linger time, so the socket still alive. So try as the title.

That's the problem, if you use IWeb, you can 't access socket, so you can't release any socket. But after a http request, the connection will be broken by server, I guess you send the 7th request within the network linger time, so the socket still alive. So try as the title.

:confused: :confused:
Thank you for your patinet.
I have added WEBREQUEST_NOKEEPALIVE in WebOpts, nothing be changed; and
I have been try to release the IWeb , but the socket also be occupyed,
It's too ugly to send the Http Request after linger time( 30 s );
I woder why the device socket should be keep during linger time?
Can we modify some label to release device sockets?
Best wishes

:confused: :confused:
Thank you for your patinet.
I have added WEBREQUEST_NOKEEPALIVE in WebOpts, nothing be changed; and
I have been try to release the IWeb , but the socket also be occupyed,
It's too ugly to send the Http Request after linger time( 30 s );
I woder why the device socket should be keep during linger time?
Can we modify some label to release device sockets?
Best wishes

By the way, the device sockets can be used at once if exit the App

By the way, the device sockets can be used at once if exit the App

Maybe the problem cann't be solved,
To improve the net efficiency, Brew limit that each used device socket must be alive in linger time; so we have to abide the request.
but What puzzle me is
why device socket can be used at once after exiting the App, but it's no use of releasing the IWep? What is difference between the two operations?

Maybe the problem cann't be solved,
To improve the net efficiency, Brew limit that each used device socket must be alive in linger time; so we have to abide the request.
but What puzzle me is
why device socket can be used at once after exiting the App, but it's no use of releasing the IWep? What is difference between the two operations?

the linger time is 30s, but it will be success in resume the Http request after 10s;
Who can tell me why?
I will appreciate for your advice.

the linger time is 30s, but it will be success in resume the Http request after 10s;
Who can tell me why?
I will appreciate for your advice.

qier86 wrote:the linger time is 30s, but it will be success in resume the Http request after 10s;
Who can tell me why?
I will appreciate for your advice.
if the socket is still alive in the linger time and it's status is idle, then you send a request, it should be OK.

qier86 wrote:the linger time is 30s, but it will be success in resume the Http request after 10s;
Who can tell me why?
I will appreciate for your advice.
if the socket is still alive in the linger time and it's status is idle, then you send a request, it should be OK.

:D
Firstly, thank for your advice;
Through testing in many ways, Following conclusions were get;
Can you give me some advises about the conclusions?
Best wishes.
1) if set WEBREQUEST_NOKEEPALIVE in IWepOpt, Brew will create a new socket for the Http Request at once no matter the linger time in your device.
2)if use default setting in IWepOpt, Brew will keep the used sockets alive in linger time, then no connectiion can be created for the new Http Request in the linger tme.

:D
Firstly, thank for your advice;
Through testing in many ways, Following conclusions were get;
Can you give me some advises about the conclusions?
Best wishes.
1) if set WEBREQUEST_NOKEEPALIVE in IWepOpt, Brew will create a new socket for the Http Request at once no matter the linger time in your device.
2)if use default setting in IWepOpt, Brew will keep the used sockets alive in linger time, then no connectiion can be created for the new Http Request in the linger tme.

Hey I think the best way is send your request one by one.

Hey I think the best way is send your request one by one.

Ok, I already use IShell_SetTimer() to make the each Http Request serial;
Appreciate for your posts.

Ok, I already use IShell_SetTimer() to make the each Http Request serial;
Appreciate for your posts.

The MAX Socket is 6 in the handset and other work environment.
We can design a architecture currently which the max 6 socket be sended in the same time. The 7th request can be sended after the one finished or aborted that the 7th request in waiting queue. Likewise the 8th ... nth request wait in waiting queue.
qier86 wrote::confused: Hello :
The MAX Sockets is 6 in the handset.
using IWeb, send 7 Http get request at the same time,
only last six request can be responsed, the first was ignored;
is there something additional I need to do to resume the connection??
the version is Brew3.15
//Following code is including in WebOpts
awo[i].nId = WEBOPT_FLAGS;
awo[i].pVal = (void *)WEBREQUEST_FORCENEWCONN;
i++;
Please give me some advices, best wishes!

The MAX Socket is 6 in the handset and other work environment.
We can design a architecture currently which the max 6 socket be sended in the same time. The 7th request can be sended after the one finished or aborted that the 7th request in waiting queue. Likewise the 8th ... nth request wait in waiting queue.
qier86 wrote::confused: Hello :
The MAX Sockets is 6 in the handset.
using IWeb, send 7 Http get request at the same time,
only last six request can be responsed, the first was ignored;
is there something additional I need to do to resume the connection??
the version is Brew3.15
//Following code is including in WebOpts
awo[i].nId = WEBOPT_FLAGS;
awo[i].pVal = (void *)WEBREQUEST_FORCENEWCONN;
i++;
Please give me some advices, best wishes!

kenson wrote:The MAX Socket is 6 in the handset and other work environment.
We can design a architecture currently which the max 6 socket be sended in the same time. The 7th request can be sended after the one finished or aborted that the 7th request in waiting queue. Likewise the 8th ... nth request wait in waiting queue.
The key problem is how can you know that there is an idle sockt by IWeb?
can you tell me some detail?

kenson wrote:The MAX Socket is 6 in the handset and other work environment.
We can design a architecture currently which the max 6 socket be sended in the same time. The 7th request can be sended after the one finished or aborted that the 7th request in waiting queue. Likewise the 8th ... nth request wait in waiting queue.
The key problem is how can you know that there is an idle sockt by IWeb?
can you tell me some detail?

It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
If have some problem please let me know.
My e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
qier86 wrote:The key problem is how can you know that there is an idle sockt by IWeb?
can you tell me some detail?

It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
If have some problem please let me know.
My e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
qier86 wrote:The key problem is how can you know that there is an idle sockt by IWeb?
can you tell me some detail?

kenson wrote:It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
Thank you for the post.
But the device socket will not be released at once after receiving data by IWep in default setting.
you can try to send 8 Http requests, whose URL are different, at the same time through
for(i= 0 ; i <8 ; i++)
{
send http request
.......

then, in linger time the 7th and 8th Http request will fail even the other 6 requests were finished.

kenson wrote:It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
Thank you for the post.
But the device socket will not be released at once after receiving data by IWep in default setting.
you can try to send 8 Http requests, whose URL are different, at the same time through
for(i= 0 ; i <8 ; i++)
{
send http request
.......

then, in linger time the 7th and 8th Http request will fail even the other 6 requests were finished.

kenson wrote:It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
If have some problem please let me know.
My e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
Hey What's the difference from send request one by one? e.g. sending==>receiving==>received==>sending==>receiving==>received...

kenson wrote:It is a very easy architecture that we can send the 8th socket from queue after the one request receiving data finished.
If have some problem please let me know.
My e-mail: eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%22%20%63%6c%61%73%73%3d%22%62%62%2d%65%6d%61%69%6c%22%3e%79%75%79%61%6e%67%2e%64%6c%75%74%40%31%36%33%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
Hey What's the difference from send request one by one? e.g. sending==>receiving==>received==>sending==>receiving==>received...

My architecture below
1, send request 0 ... nth
for(i = 0; i < MAX_HTTP_REQUEST; i++)
{
SendRequest(RequestHandle);

Http_Queue_Request(RequestHandle);
2, call the function after the one finished
Http_QueueNotification(RequestLink)
{
for(i = 0; i < MAX_HTTP_REQUEST; i++)
{
SendRequest(RequestHandle);
}

qier86 wrote:Thank you for the post.
But the device socket will not be released at once after receiving data by IWep in default setting.
you can try to send 8 Http requests, whose URL are different, at the same time through
for(i= 0 ; i <8 ; i++)
{
send http request
.......

then, in linger time the 7th and 8th Http request will fail even the other 6 requests were finished.

My architecture below
1, send request 0 ... nth
for(i = 0; i < MAX_HTTP_REQUEST; i++)
{
SendRequest(RequestHandle);

Http_Queue_Request(RequestHandle);
2, call the function after the one finished
Http_QueueNotification(RequestLink)
{
for(i = 0; i < MAX_HTTP_REQUEST; i++)
{
SendRequest(RequestHandle);
}

qier86 wrote:Thank you for the post.
But the device socket will not be released at once after receiving data by IWep in default setting.
you can try to send 8 Http requests, whose URL are different, at the same time through
for(i= 0 ; i <8 ; i++)
{
send http request
.......

then, in linger time the 7th and 8th Http request will fail even the other 6 requests were finished.

You are right. As you think the URL be sended one by one equal with six by six.
xacheng wrote:Hey What's the difference from send request one by one? e.g. sending==>receiving==>received==>sending==>receiving==>received...

You are right. As you think the URL be sended one by one equal with six by six.
xacheng wrote:Hey What's the difference from send request one by one? e.g. sending==>receiving==>received==>sending==>receiving==>received...