On 11/09/06, Gaspar Chilingarov <[EMAIL PROTECTED]> wrote:
Hello all vimmers!
I would like to ask - how should I add additional stuff in
RealWaitForChar? I have some network protocol, when another side
periodically send me keepalive messages(every 10-15 secs). I would like
to receive them and process. In GUI based vim it was pretty simple --
using gdk_input_add or similar thing. In other hand I would like to
console users have same benefits - I've added handlers in
RealWaitForChar, but ... it processes only first message on it's own.
All latter messages are received, but does not processed -- until I
press some key periodically, thus causing remote site timeouting and
aborting the connection.
I've implemented it in a quite similar way to FEAT_MOUSE_GPM and
USE_XSMP implementations.
What can I miss there? Any recommendations where to look?
Thanks in advance, Gaspar
There is a patched Vim7 here
(http://theclapp.org/repos/vim70+async+ecl/) that contains code to
handle network callbacks. However, beware! I think there are subtle
bugs in way this works with Vim's code path. You cannot just randomly
go calling functions from RealWaitForChar (for example, appending
text), and expect everything to be OK. You probably want to look in
network_io.c and os_unix.c.
Cheers
Brad