[lkml]   [2002]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectHow to implement listen and accept routines

I want to make my protocol connection-oriented. I am really stuck with
listen and accept routines :-(. As examples, I took:
int tcp_listen_start(struct sock *sk);
struct sock *tcp_accept(struct sock *sk, int flags, int *err);

Could anybody briefly explain me how should I implement them? I know the
purpose of those functions in the userland.
Mainly I have 2 questions:
1. What else besides changing sk->state to TCP_LISTEN should my
"listen_start" do?
2. How do I get a pending "socket" in my "accept" function. Should
sock_alloc a new one or copy it from some queue?

Thanks for any help!

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.044 / U:0.744 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site