Re: struct sock change in kernel 2.6

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: lijin liu
Date: Wednesday, December 22, 2010 - 5:18 pm

Hi Bharath,all,

On Thu, Dec 23, 2010 at 12:31 AM, Bharath H S <bhslinker@gmail.com> wrote:


It seems that I found the answer.

After reading the source code, comparing the codes of the two versions
I got the answer:

1.We can use sk_wq->wait instead of sk_wait.
2.Use reqsk_queue_empty(struct request_sock_queue*) to check if there
is a new connection to accept. (thsi method is in net/request_sock.h)
we can use it like:

 	struct inet_connection_sock *isock = inet_csk(socket->sk);
	if(reqsk_queue_empty(&isock->icsk_accept_queue)){
                 //sleep here
        }

I test them in my code, works well.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
struct sock change in kernel 2.6, lijin liu, (Tue Dec 21, 11:17 pm)
Re: struct sock change in kernel 2.6, Bharath H S, (Wed Dec 22, 9:31 am)
Re: struct sock change in kernel 2.6, lijin liu, (Wed Dec 22, 5:18 pm)
Re: struct sock change in kernel 2.6, Mulyadi Santosa, (Wed Dec 22, 10:16 pm)
Re: struct sock change in kernel 2.6, lijin liu, (Wed Dec 22, 10:19 pm)