all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Tury <tury.peter@gmail.com>
Subject: asynchronous process management on WinWP; buffering problem?
Date: Fri, 14 Apr 2006 07:14:54 GMT	[thread overview]
Message-ID: <10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net> (raw)

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

             reply	other threads:[~2006-04-14  7:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-14  7:14 Peter Tury [this message]
2006-04-14 17:43 ` asynchronous process management on WinWP; buffering problem? kgold
2006-04-14 19:11   ` Lennart Borgman
     [not found]   ` <mailman.414.1145041920.9609.help-gnu-emacs@gnu.org>
2006-04-14 20:13     ` Miles Bader
2006-04-15  7:12       ` Lennart Borgman
     [not found]       ` <mailman.434.1145085136.9609.help-gnu-emacs@gnu.org>
2006-04-15  9:17         ` Jason Rumney
2006-04-15 15:26           ` Lennart Borgman
2006-04-15 17:54             ` Benjamin Riefenstahl
2006-04-15 23:50               ` Lennart Borgman
2006-04-17 13:08                 ` Benjamin Riefenstahl
2006-04-17 16:02                   ` Lennart Borgman
     [not found]               ` <mailman.460.1145145017.9609.help-gnu-emacs@gnu.org>
2006-04-16  0:21                 ` Miles Bader
2006-04-16  7:15                   ` Eli Zaretskii
     [not found]           ` <mailman.437.1145114823.9609.help-gnu-emacs@gnu.org>
2006-04-15 23:30             ` Miles Bader
2006-04-14 20:42     ` Jason Rumney
2006-04-15 20:56 ` Peter Tury
2006-04-19 15:05   ` Peter Tury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='10m877fael0h3.1kg7y6ljn4qmb$.dlg@40tude.net' \
    --to=tury.peter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.