Ken Takata wrote:
> I found some problems with the channel feature. (v7.4.1246)
>
> 1. On Win32 GUI, vim hangs up.
>
> :let handle = ch_open('localhost:8765', 'json')
> :echo ch_sendexpr(handle, 'hello!')
> Vim hangs up.
>
> Or,
>
> :let handle = ch_open('localhost:8765', 'json')
> :quit
> Vim hangs up.
>
> The following patch seems to fix this:
>
> --- a/src/vim.h
> +++ b/src/vim.h
> @@ -549,7 +549,7 @@ typedef unsigned long u8char_T; /* l
> # ifdef HAVE_SYS_POLL_H
> # include <sys/poll.h>
> # define HAVE_POLL
> -# elif defined(WIN32) && !defined(FEAT_GUI_W32)
> +# elif defined(WIN32)
> # define HAVE_SELECT
> # else
> # ifdef HAVE_POLL_H
>
> I'm not sure this is enough.
> Maybe returning an error code in channel_read() is better?
I believe with Win32 GUI we are using Windows messages, thus select()
might block receiving any messages. We need some way to wait for the
message to arrive, which should cause channel_read() to be invoked
(that's in src/gui_w48.c). Perhaps something like what gui_mch_update()
is doing?
> 2. On Win32 GUI, socket is closed unexpectedly.
>
> After the above patch is applied:
>
> :let handle = ch_open('localhost:8765', 'json')
> :echo ch_sendexpr(handle, 'hello!')
> The socket is automatically closed.
>
> But this doesn't close the socket:
> :call ch_sendexpr(handle, 'hello!', "MyHandler")
>
> This doesn't occur on Win32 CUI.
I haven't had time yet to look into the Win32 GUI implementation.
> 3. Crashes when opening the same socket twice.
>
> :let handle = ch_open('localhost:8765', 'json')
> :let handle = ch_open('localhost:8765', 'json')
> Vim crashes.
>
> This also occurs on Linux.
Reallocating an array with pointers in it is not a good idea..
--
"Microsoft is like Coke. It's a secret formula, all the money is from
distribution, and their goal is to get Coke everywhere. Open source is like
selling water. There are water companies like Perrier and Poland Spring, but
you're competing with something that's free." -- Carl Howe
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.