From owner-freebsd-stable@FreeBSD.ORG Thu Oct 6 22:23:41 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85FC616A41F for ; Thu, 6 Oct 2005 22:23:41 +0000 (GMT) (envelope-from lefty@ene.asda.gr) Received: from mx3.asda.gr (ene.asda.gr [193.92.118.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A90143D45 for ; Thu, 6 Oct 2005 22:23:40 +0000 (GMT) (envelope-from lefty@ene.asda.gr) Received: by mx3.asda.gr (Postfix, from userid 58) id BE6C51146F; Fri, 7 Oct 2005 01:23:38 +0300 (EEST) X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on ene.asda.gr X-Spam-Level: X-Spam-Status: score=-103.8 autolearn=ham tests=ALL_TRUSTED,AWL,BAYES_00, USER_IN_WHITELIST Received: from [193.92.118.162] (lefty.ene.asda.gr [193.92.118.162]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Lefteris Tsintjelis", Issuer "ASDA Root CA" (verified OK)) by mx3.asda.gr (Postfix) with ESMTP id 095341142D for ; Fri, 7 Oct 2005 01:23:27 +0300 (EEST) Message-ID: <4345A3DA.1020803@ene.asda.gr> Date: Fri, 07 Oct 2005 01:23:22 +0300 From: Lefteris Tsintjelis Organization: ASDA User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit Subject: setsockopt and SO_RCV/SNDTIMEO X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2005 22:23:41 -0000 Hi, I am trying to set something like this up but it doesn't seem to work as I expect it (unless I expect wrong): timeout.tv_sec = 4; timeout.tv_usec = 0; if(setsockopt(listenSocket, SOL_SOCKET, SO_RCVTIMEO, (void *)&timeout, sizeof(timeout)) == -1) fprintf(stdout, "setsockopt SO_RCVTIMEO failed: %s\n", strerror(errno)); if(setsockopt(listenSocket, SOL_SOCKET, SO_SNDTIMEO, (void *)&timeout, sizeof(timeout)) == -1) fprintf(stdout, "setsockopt SO_SNDTIMEO failed: %s\n", strerror(errno)); When I telnet to the socket, the socket always stays connected. The timer doesn't seem to work right. Am I missing anything here or is this broken? Please CC Thnx, Lefteris