help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asynchronous process management on WinWP; buffering problem?


From: Peter Tury
Subject: asynchronous process management on WinWP; buffering problem?
Date: Fri, 14 Apr 2006 07:14:54 GMT
User-agent: 40tude_Dialog/2.0.15.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]