From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.user Subject: Re: How to abort a read from a socket after some time? Date: Sun, 21 Jan 2024 13:34:30 -0500 Message-ID: <87mssy8rih.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37125"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Jan 21 19:35:04 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rRces-0009Nh-Nt for guile-user@m.gmane-mx.org; Sun, 21 Jan 2024 19:35:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRceU-0007bh-RS; Sun, 21 Jan 2024 13:34:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRceR-0007b6-4j for guile-user@gnu.org; Sun, 21 Jan 2024 13:34:35 -0500 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRceP-00059E-NA for guile-user@gnu.org; Sun, 21 Jan 2024 13:34:34 -0500 Original-Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-783182d4a09so256009885a.2 for ; Sun, 21 Jan 2024 10:34:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705862072; x=1706466872; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=yMBU3T2KJQaYkyuTb/vueoAEiktsrgjtU6us4LRs9mA=; b=Pjh9WdhU7hfKB09rn3MPpfksT4ojqHlwHgAlDu7evMLH899t62WGa4pJ3BR+qE8ER0 9/iu2q9AJZPCDPXGWV9RN1JVHWK530M23jPv/s4J5F5aukW23TaDrkyphFnC/eJWIDSk KmFEKe4K568nFhZN+2kkz/QEd4hXBAL6EWjpE08AFaTqRoOOfzF3H7dz86RayaJ9YsR8 QXnMrGyGDYBxK7x4JNN1gB9T0ECn7VIWp6urHzlLSmTJNzratBEWZQU5IW7166IioqdY wPywePOoc+iiShfsWGj7eTa7We408cbHB+Eczif7jBV03MW7y860/HkxFXy33IdNRr5V cykw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705862072; x=1706466872; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yMBU3T2KJQaYkyuTb/vueoAEiktsrgjtU6us4LRs9mA=; b=vK+DhQHNCMEbEdo89sb4A+nHgD2aMWAIDhaLJn8vAxTbdLx/eAmu761gNQXEd7wWmE IEo8b3XeQ98rSNQOoFW6nZZ3ptITNdMVlmucDBoqVu2Z6AnAKSSpfL6jhZSv34S71I8L NLaGpdvZUzr+79sWC9nP3YPDCHuAbCIoJoCtuvKcn+LARXDlCqBvPR6hVsG83DJ4XSdD 7/HHn5DHUWfy/h38ZiyHNnCd/xjPvsVWM4qTmaYU4UWEDupZBo/EsMj9fODozwX27QEu qG6LFpJQ/48FlTCJj0Xq+G8+3z0SzRxiErbBYzi0Y+rZVOZL3TjsYgONk8Rea6IyUC8h FAdQ== X-Gm-Message-State: AOJu0Yyb56p2jn7mNs36qDE4XuRO7M+T4H6gu6Ib32pmYX2h/FJPk5Qr GGkBwqKiFrOBcwS6Gp7ZD2/20IsQfRx5L6koxwZYP9Duq50jE6qPtHgVFhFjlAY= X-Google-Smtp-Source: AGHT+IGyKUk4G07tmivBjikUsgkZ2AsBuhexhgnZcDMqeDjX28VidoVL77GaC6bI8GYu8gAByhWmqg== X-Received: by 2002:ad4:5be2:0:b0:686:8e2e:d7df with SMTP id k2-20020ad45be2000000b006868e2ed7dfmr1050934qvc.73.1705862072230; Sun, 21 Jan 2024 10:34:32 -0800 (PST) Original-Received: from hurd (dsl-10-128-232.b2b2c.ca. [72.10.128.232]) by smtp.gmail.com with ESMTPSA id bt12-20020ad455cc000000b0068179afede6sm1692824qvb.100.2024.01.21.10.34.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 10:34:31 -0800 (PST) In-Reply-To: (Tomas Volf's message of "Sun, 21 Jan 2024 17:00:23 +0100") Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19410 Archived-At: Hi Tomas, Tomas Volf <~@wolfsden.cz> writes: > Hello, > > I am trying to figure out how to abort a read from a socket after some time > elapses. I failed to figure out how to do so. If the reason you want to abort reading from a socket is because the socket may not be ready, you could use select(2), which has a timeout value. See man 2 select or the corresponding 'select' procedure documented in the Guile Reference manual. -- Thanks, Maxim