🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98868

Re: 18.57: PROCESS-SEND-STRING of large strings fails (sometimes)

#98868
From: Joe Wells
Date: Fri, 22 Feb 1991 20:06
51 lines
2122 bytes
(emacs-version)
"GNU Emacs 18.57.14 of Tue Feb 19 1991 on bigbird (berkeley-unix)"

layer@franz.com (Kevin Layer) writes:

   I've noticed that 18.57 often gives me the error

	   writing to process: no more processes: ....

   when I write large amounts of data to a process created with
   OPEN-NETWORK-STREAM.

This is because of the use of POSIX style non-blocking I/O in preference
to Berkeley style non-blocking I/O, whenever POSIX non-blocking I/O is
available.  I was unable to post large articles in GNUS because of this
problem.  The patch I had been using prior to yours was to use O_NDELAY
instead of O_NONBLOCK when setting up the socket:

------------------------------------------------
*** process.c-dist	Tue Jan 15 20:28:48 1991
--- process.c	Tue Feb 19 01:18:51 1991
***************
*** 1334,1342 ****
    chan_process[inch] = proc;
  
- #ifdef O_NONBLOCK
-   fcntl (inch, F_SETFL, O_NONBLOCK);
- #else
  #ifdef O_NDELAY
    fcntl (inch, F_SETFL, O_NDELAY);
  #endif
  #endif
--- 1334,1342 ----
    chan_process[inch] = proc;
  
  #ifdef O_NDELAY
    fcntl (inch, F_SETFL, O_NDELAY);
+ #else
+ #ifdef O_NONBLOCK
+   fcntl (inch, F_SETFL, O_NONBLOCK);
  #endif
  #endif
------------------------------------------------

I think the correct patch might be to select on the socket for
writability, instead of sleeping for 1 second.

-- 
Enjoy,

Joe Wells <jbw@bu.edu>
Technical Details
Message-ID: <JBW.91Feb22150601@bigbird.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage
References: <9102220152.AA06046@vapor.Franz.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,797fb98ace93f553,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-02-22 12:06:01 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage
From: jbw@BIGBIRD.BU.EDU (Joe Wells)
Newsgroups: gnu.emacs.bug
Subject: Re: 18.57: PROCESS-SEND-STRING of large strings fails (sometimes)
Message-ID: <JBW.91Feb22150601@bigbird.bu.edu>
Date: 22 Feb 91 20:06:01 GMT
References: <9102220152.AA06046@vapor.Franz.COM>
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: Boston University Computer Science Department
Lines: 51
Approved: bug-gnu-emacs@prep.ai.mit.edu