zhongwang huang
2012-04-16 01:25:46 UTC
Hi,
I had encouraged an issue when I used the asio example server3, would
you please help me to analyze what's happen in this case, the case like
this:
*******************************************************
Client code:
Main()
{
creat();
Bind();
Listen();
Accept();
While( true)
{
Send_request();
Recv_response();
//Process_response();
}
}
******************************************************
Well, when I start the client, we could send some requests to the
server and we also could receive the responses. But, some minutes later,
the client block in the recv() API in recv_response() function. While this
time , we use the tcpdump to capture the package at both the server side and
client side, we found that the client had already sent the request to the
server, and the protocol stack on the server side had already received the
request data.
At this time, if we use the GDB to monitor the stack of the server3, we
found that there is a thread block on epoll_wait function, my problem is
that:
1. The data had already received by the kernel protocol stack, why the
epoll_wait function couldnt return?
2. Is this issue relation to the ET(Edge Trigger) mode epoll?
3. We found that we can reproduce this problem when we set the server
with multiple thread mode easily. And so far, we had not reproduced this when
we set the server with single thread mode. I think if this problem is
relate to the ET mode of epoll, reproduce that in the single thread just a time
problem, am I right??
4. Is there has a switch for the ET or LT for epoll in 1.49 asio???
Thanks very much.
Verient
I had encouraged an issue when I used the asio example server3, would
you please help me to analyze what's happen in this case, the case like
this:
*******************************************************
Client code:
Main()
{
creat();
Bind();
Listen();
Accept();
While( true)
{
Send_request();
Recv_response();
//Process_response();
}
}
******************************************************
Well, when I start the client, we could send some requests to the
server and we also could receive the responses. But, some minutes later,
the client block in the recv() API in recv_response() function. While this
time , we use the tcpdump to capture the package at both the server side and
client side, we found that the client had already sent the request to the
server, and the protocol stack on the server side had already received the
request data.
At this time, if we use the GDB to monitor the stack of the server3, we
found that there is a thread block on epoll_wait function, my problem is
that:
1. The data had already received by the kernel protocol stack, why the
epoll_wait function couldnt return?
2. Is this issue relation to the ET(Edge Trigger) mode epoll?
3. We found that we can reproduce this problem when we set the server
with multiple thread mode easily. And so far, we had not reproduced this when
we set the server with single thread mode. I think if this problem is
relate to the ET mode of epoll, reproduce that in the single thread just a time
problem, am I right??
4. Is there has a switch for the ET or LT for epoll in 1.49 asio???
Thanks very much.
Verient