From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Tury Newsgroups: gmane.emacs.help Subject: asynchronous process management on WinWP; buffering problem? Date: Fri, 14 Apr 2006 07:14:54 GMT Organization: Nokia Message-ID: <10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145000452 29160 80.91.229.2 (14 Apr 2006 07:40:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Apr 2006 07:40:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 14 09:40:50 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FUIv9-00029v-JZ for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Apr 2006 09:40:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FUIv8-0004St-Vi for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Apr 2006 03:40:47 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fi.sn.net!newsfeed2.fi.sn.net!feeder2.news.jippii.net!feeder1.news.jippii.net!nntp.inet.fi!inet.fi!newsfeed1.nokia.com!news1.nokia.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: 40tude_Dialog/2.0.15.1 Original-Lines: 57 Original-NNTP-Posting-Host: 172.24.170.83 Original-X-Complaints-To: newsmaster@nokia.com Original-X-Trace: news1.nokia.com 1144998894 172.24.170.83 (Fri, 14 Apr 2006 10:14:54 EET DST) Original-NNTP-Posting-Date: Fri, 14 Apr 2006 10:14:54 EET DST Original-Xref: shelby.stanford.edu gnu.emacs.help:138743 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34361 Archived-At: Hi, I try to control program xxx on MS WinXP from EmacsW32 (cvs). xxx runs in DOS window normally and after a command it reads from stdin (until newline), handles the input and, after another command, writes result to stdout. However it seems that some buffering (in Emacs? in MS Windows' stdin/stdout?) tries to kill me: I can't see the results (from stdout) in the associated buffer, only if it is long enough. At least it seems so: if I send many "\n"-s (to "generate" a lot of prompts (to fill up the buffer?)) then I get everything together after a while (of course, if I run the program normally (=in a DOS window) everything works fine)... I hope I could handle this through filter functions, but... ...my bigger problem is that it seems that some (too long?) data cannot be sent correctly. My question: do you know some easy "tricks" how to log/save/loopback/... every bytes sent by Emacs to (the stdin for) an async. process? xxx doesn't writes them back to stdout, so I can't see now what is sent exactly, but I see the error message -- what shouldn't happen, since the input I send from Emacs is good? My problematic input e.g.: (process-send-string h248-process "43 6F 6E 74 65 78 74 20 3D 20 24 20 7B 20 50 72 69 6F 72 69 74 79 20 3D 20 31 35 2C 20 41 64 64 20 3D 20 24 20 7B 20 4D 65 64 69 61 20 7B 20 4C 6F 63 61 6C 43 6F 6E 74 72 6F 6C 20 7B 20 4D 6F 64 65 20 3D 20 53 65 6E 64 52 65 63 65 69 76 65 2C 20 52 65 73 65 72 76 65 64 56 61 6C 75 65 20 3D 20 4F 46 46 2C 20 52 65 73 65 72 76 65 64 47 72 6F 75 70 20 3D 20 4F 46 46 2C 20 62 63 70 2F 42 4E 43 43 68 61 72 20 3D 20 41 61 6C 32 20 2C 20 74 68 72 65 65 67 75 70 2F 6D 6F 64 65 20 3D 20 53 75 70 70 20 2C 20 74 68 72 65 65 67 75 70 2F 75 70 76 65 72 73 69 6F 6E 73 20 3D 20 32 20 2C 20 74 68 72 65 65 67 75 70 2F 64 65 6C 65 72 72 73 64 75 20 3D 20 59 65 73 20 2C 20 74 68 72 65 65 67 75 70 2F 69 6E 74 65 72 66 61 63 65 20 3D 20 43 4E 20 2C 20 74 68 72 65 65 67 75 70 2F 69 6E 69 74 64 69 72 20 3D 20 49 6E 20 20 7D 20 2C 20 4C 6F 63 61 6C 20 7B 20 6D 3D 61 75 64 69 6F 20 2D 20 2D 20 2D 63 3D 41 54 4D 20 4E 53 41 50 20 24 61 3D 76 73 65 6C 3A 55 4D 54 53 2D 41 4D 52 20 2D 20 2D 20 61 3D 63 6F 64 65 63 63 6F 6E 66 69 67 3A 30 32 30 35 41 35 41 35 30 34 61 3D 65 65 63 69 64 3A 24 0A 20 7D 20 20 7D 20 20 7D 20 7D 20 \n\n") I tried both pipe and pty process-connection-type. It seems as if somewhere (before the real end) a "\n" would be sent (what stops reading of the stdin in xxx, thus the got data (=the "first half") is obviuosly incorrect). Can some automatic coding cause this problem (I see that 0A="\n" is sent, but 0A there should be a simple string of characters "0" and "A".) If I send EOF explicitly (with (process-send-eof h248-process)), it messes up xxx: it start to write an error message in an infinite(?) loop, so I have to delete-process then. Thus I think Emacs doesn't send EOF hiddenly during the sending of the above, normal input (even if it is longer than 500 bytes) -- how can I check this? Thanks!! P