Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 21 Feb 2002 20:55:02 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 21 Feb 2002 20:54:52 -0500 Received: from courage.cs.stevens-tech.edu ([155.246.89.70]:26568 "HELO courage.cs.stevens-tech.edu") by vger.kernel.org with SMTP id ; Thu, 21 Feb 2002 20:54:43 -0500 Date: Thu, 21 Feb 2002 20:54:41 -0500 (EST) From: Marek Zawadzki To: Subject: How to implement listen and accept routines Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hello, 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! -marek - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/