From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: non-blocking socket io: data limit on read? Date: 01 Jul 2004 22:07:13 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87y8m3l9mm.fsf@tapsellferrier.co.uk> References: <87smk4zuvv.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1088716651 6974 80.91.224.253 (1 Jul 2004 21:17:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Jul 2004 21:17:31 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jul 01 23:17:11 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bg8ve-0006aK-00 for ; Thu, 01 Jul 2004 23:17:10 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bg8ve-0007hm-00 for ; Thu, 01 Jul 2004 23:17:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bg8xQ-0003tu-Fl for emacs-devel@quimby.gnus.org; Thu, 01 Jul 2004 17:19:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bg8xN-0003tE-IS for emacs-devel@gnu.org; Thu, 01 Jul 2004 17:18:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bg8xM-0003su-P8 for emacs-devel@gnu.org; Thu, 01 Jul 2004 17:18:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bg8xM-0003sk-JK for emacs-devel@gnu.org; Thu, 01 Jul 2004 17:18:56 -0400 Original-Received: from [80.168.156.73] (helo=tf1.tapsellferrier.co.uk) by monty-python.gnu.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.34) id 1Bg8vY-0001zA-FY for emacs-devel@gnu.org; Thu, 01 Jul 2004 17:17:05 -0400 Original-Received: from tf2.tapsellferrier.co.uk ([80.168.156.74] helo=kanga) by tf1.tapsellferrier.co.uk with esmtp (Exim 4.30 #1 (Debian)) id 1Bg8mT-0008Fk-RZ for ; Thu, 01 Jul 2004 22:07:41 +0100 Original-Received: from [127.0.0.1] (helo=kanga ident=nferrier) by kanga with esmtp (Exim 4.30 #1 (Debian)) id 1Bg8mM-0007tT-3m for ; Thu, 01 Jul 2004 22:07:36 +0100 Original-To: emacs-devel@gnu.org In-Reply-To: <87smk4zuvv.fsf@mail.jurta.org> Original-Lines: 73 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25363 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25363 I have the beginnings of an nbio imap client. It sets up the socket like this: (open-network-stream-nowait "nbimap" con-buffer server 143 'nbimap-sentinel 'nbimap-filter) The sentinel doesn't do anything special, it just sets states based on the connection status. The filter parses the data passed into it, and then inserts it into the buffer. But I am getting some read problems. Large data sets don't arrive in full. I get a truncated form of the data. The bit I'm recieving is the last part, so it's not that my filter is being called twice. As an example I'm issuing an IMAP list command: 0x LIST "" "*" which returns all my folders, here's what goes over the socket (sniffed): T 127.0.0.1:143 -> 127.0.0.1:48929 [AP] * LIST (\HasNoChildren) "." "INBOX.clients.earthport"..* LIST (\HasNoChildren) "." "INBOX.gnu.gdb"..* LIS T (\HasNoChildren) "." "INBOX.Spam.test"..* LIST (\HasNoChildren) "." "INBOX.exim"..* LIST (\HasNoChildre n) "." "INBOX.Spam.clever"..* LIST (\HasNoChildren) "." "INBOX.servlets.jcp"..* LIST (\HasNoChildren) "." "INBOX.gnu.libxmlxsl"..* LIST (\HasNoChildren) "." "INBOX.gnu.scheme"..* LIST (\HasNoChildren) "." "INBO X.lispweb"..* LIST (\HasNoChildren) "." "INBOX.linux"..* LIST (\HasNoChildren) "." "INBOX.nic.policematte r"..* LIST (\HasNoChildren) "." "INBOX.clients.sweetandmaxwell.java-tips"..* LIST (\HasNoChildren) "." "I NBOX.gnu.emacs.nics-tip-of-the-day"..* LIST (\HasNoChildren) "." "INBOX.schemeunderground"..* LIST (\HasN oChildren) "." "INBOX.debian.laptop"..* LIST (\HasNoChildren) "." "INBOX.tf.net"..* LIST (\HasNoChildren) "." "INBOX.gnu.servletapi"..* LIST (\HasNoChildren) "." "INBOX.gnu.gcj"..* LIST (\HasNoChildren) "." "IN BOX.imapua-broken"..* LIST (\HasNoChildren) "." "INBOX.xsl"..* LIST (\HasNoChildren) "." "INBOX.wikipedia "..* LIST (\HasChildren) "." "INBOX.tf"..* LIST (\HasChildren) "." "INBOX.servlets"..* LIST (\HasNoChildr en) "." "INBOX.nic.jobs"..* LIST (\HasNoChildren) "." "INBOX.rest"..* LIST (\HasNoChildren) "." "INBOX.po stgresql"..* LIST (\HasNoChildren) "." "INBOX.oracle"..* LIST (\HasNoChildren) "." "INBOX.nic.egg"..* LIS T (\HasChildren) "." "INBOX.nic"..* LIST (\HasChildren) "." "INBOX.Spam"..* LIST (\HasNoChildren) "." "IN BOX.java"..* LIST (\HasNoChildren) "." "INBOX.gnu.paperclips"..* LIST (\HasNoChildren) "." "INBOX.gnu.mai lutils"..* LIST (\HasNoChildren) "." "INBOX.gnu.jaxp"..* LIST (\HasNoChildren) "." "INBOX.gnu.javamail".. * LIST (\HasNoChildren) "." "INBOX.gnu.java"..* LIST (\HasNoChildren) "." "INBOX.gnu.gjdoc"..* LIST (\Has Children) "." "INBOX.gnu.emacs"..* LIST (\HasNoChildren) "." "INBOX.gnu.cvs"..* LIST (\HasNoChildren) "." "INBOX.gnu.classpathx-administrivia"..* LIST (\HasChildren) "." "INBOX.gnu"..* LIST (\HasNoChildren) "." "INBOX.ferrier_me_uk"..* LIST (\HasChildren) "." "INBOX.debian"..* LIST (\HasNoChildren) "." "INBOX.clie nts.withyham"..* LIST (\HasChildren) "." "INBOX.clients.sweetandmaxwell"..* LIST (\HasChildren) "." "INBO X.clients"..* LIST (\HasNoChildren) "." "INBOX.articles"..* LIST (\HasNoChildren) "." "INBOX.affs"..* LIS T (\HasNoChildren) "." "INBOX.Trash"..* LIST (\HasNoChildren) "." "INBOX.Sent"..* LIST (\Marked \HasChild ren) "." "INBOX"..02 OK LIST completed... But what I get in the data argument to the filter function is this: "BOX.debian\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.clients.withyham\"\n* LIST (\\HasChildren) \".\" \"INBOX.clients.sweetandmaxwell\"\n* LIST (\\HasChildren) \".\" \"INBOX.clients\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.articles\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.affs\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.Trash\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.Sent\"\n* LIST (\\Marked \\HasChildren) \".\" \"INBOX\"\n02 OK LIST completed.\n" Clearly truncated. My Emacs version is: GNU Emacs 21.3.50.2 (i686-pc-linux-gnu, X toolkit) It's pretty complicated code (process.c) so I don't want to have to get into it unless I need to /8-> Has anyone got any ideas? -- Nic Ferrier http://www.tapsellferrier.co.uk