From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hackney Newsgroups: gmane.emacs.devel Subject: Re: [feature request] SOCK_SEQPACKET Date: Tue, 24 Nov 2009 16:17:20 -0500 Message-ID: <2e0e1cd40911241317w487d85eds4826f71cd46ab1b4@mail.gmail.com> References: <2e0e1cd40911232205g5a929ebdgd946f88afa3ecbd9@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1259121824 4762 80.91.229.12 (25 Nov 2009 04:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2009 04:03:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 25 05:03:37 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ND96O-0003pc-JV for ged-emacs-devel@m.gmane.org; Wed, 25 Nov 2009 05:03:36 +0100 Original-Received: from localhost ([127.0.0.1]:36137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND96O-0002Ig-50 for ged-emacs-devel@m.gmane.org; Tue, 24 Nov 2009 23:03:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ND2lk-0004Xo-3C for emacs-devel@gnu.org; Tue, 24 Nov 2009 16:17:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ND2lf-0004TA-9a for emacs-devel@gnu.org; Tue, 24 Nov 2009 16:17:51 -0500 Original-Received: from [199.232.76.173] (port=51683 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND2lf-0004T7-3k for emacs-devel@gnu.org; Tue, 24 Nov 2009 16:17:47 -0500 Original-Received: from mail-fx0-f213.google.com ([209.85.220.213]:62585) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ND2le-0008Uu-Ma for emacs-devel@gnu.org; Tue, 24 Nov 2009 16:17:46 -0500 Original-Received: by fxm5 with SMTP id 5so7794780fxm.8 for ; Tue, 24 Nov 2009 13:17:45 -0800 (PST) Original-Received: by 10.103.81.12 with SMTP id i12mr2985391mul.37.1259097465512; Tue, 24 Nov 2009 13:17:45 -0800 (PST) Original-Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by mx.google.com with ESMTPS id e8sm4563855muf.58.2009.11.24.13.17.43 (version=SSLv3 cipher=RC4-MD5); Tue, 24 Nov 2009 13:17:43 -0800 (PST) Original-Received: by bwz7 with SMTP id 7so471076bwz.26 for ; Tue, 24 Nov 2009 13:17:43 -0800 (PST) Original-Received: by 10.204.153.197 with SMTP id l5mr6623467bkw.109.1259097462236; Tue, 24 Nov 2009 13:17:42 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Tue, 24 Nov 2009 23:03:31 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117727 Archived-At: Stefan Monnier wrote: >> [...] I noticed that Emacs can't use the SOCK_SEQPACKET type. > >> It doesn't seem like SOCK_SEQPACKET is used much, but it would be >> nice to have, if only for completeness sake. I don't really know any >> C-level Emacs programming (I'm pretty comfortable with Elisp), but I >> would be willing to help out however I can if given some guidance and >> an overview of what would need to be done. > > You can start with the patch below (guaranteed 100% untested). I know > nothing about SOCK_SEQPACKET, other than what I just read in the > manpage of `socket', so this code probably doesn't do the right thing. I'm in pretty much the same boat, as I had never even heard of SOCK_SEQPACKET until I saw that Uzbl uses it. I'll hack on it a bit to test it and make sure it works, but you'll probably want someone with legitimate socket knowledge (i.e. not me ;) to review it before committing anything I turn out. > The main problem I'd except would have to do with the fact that Emacs > will typically read and write in blocks of fixed size (like 1KB or 4KB > maybe, IIRC), so for packets smaller than that size it might work > fine, but for larger packets you may end up having to make more > substantial changes. I'll check it out. I'll definitely have to spend some more time wrapping my head around the semantics of SOCK_SEQPACKET, but I'll try to turn out something that works reliably. Thanks for the start, though! -- Daniel M. Hackney