Marcin Szamotulski wrote:

> That's a really great feature.  I am trying to implemented a gulp plugin
> (gulp is a node package used to build web apps) based on channels and
> there are two things that I has a problem with:

Thanks for the feedback.  Keep in mind that the feature is still being
developed.  Some things may just be missing.  But there can also be bugs
and things that don't work for you, so feedback is useful anyway.

> 1) when I use `job_start()` to start a server in the background and
> immediately after I call `ch_open()` to open channel to that server I am
> always refused: `E896: read from channel: Connection refused`.
> 
> However, if I check `job_status` in between (which is what
> I should do anyway), then the following `ch_open` runs fine.  There is
> no way now to communicate from the job that started that what it runs is
> ready to connect to.

It's normal for a process to have some initialization time before the
socket is ready for use.  This is implemented, it already existed for
netbeans.  Did you add a "waittime" argument?  The default is zero.

> 2) when my server sends data back to vim only the first message is
> received.  This can be reproduced by the demoserver.py example.  Just
> double the lines in `ThreadedTCPRequestHandler.handle`:
>     print("sending {}".format(encoded))
>     self.request.sendall(encoded.encode('utf-8'))
>     print("sending {}".format(encoded))
>     self.request.sendall(encoded.encode('utf-8'))
> 
> And vim will only get the first message.  It would be nice if the socket
> was reading until explicitly closed by the server.  It would be useful
> for my case to send updates from the background process spawn by the server
> that I wrote.

If you are using raw messages Vim has no clue where a message ends and
whether there is more coming.  Vim should get the second message, but
possibly only in the next read.  If it never arrives there can be a bug.
I just fixed one where raw messages were dropped when there is no
handler.

I just added the ch_logfile() function, that will be useful to find out
what is happening.

-- 
"Women marry men hoping they will change. Men marry women hoping
they will not. So each is inevitably disappointed."
 - Einstein

 /// 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.

Raspunde prin e-mail lui