Hirohito Higashi wrote:

> Hi Bram,
> 
> 2016-2-6(Sat) 6:37:07 UTC+9 Bram Moolenaar:
> > Patch 7.4.1263
> > Problem:    ch_open() hangs when the server isn't running.
> > Solution:   Add a timeout. Use a dict to pass arguments. (Yasuhiro 
> > Matsumoto)
> > Files:      runtime/doc/eval.txt, runtime/doc/channel.txt, src/channel.c,
> >             src/eval.c, src/netbeans.c, src/os_win32.c, 
> > src/proto/channel.pro,
> >             src/testdir/test_channel.vim
> 
> I found conflict between document and source.
> And I have a confirmation to specification.
> 
> ch_open() {argdict}'s waittime and timeout that the units are milliseconds.
> But in fact, this is using as the seconds.
> 
> code>in channel.c
> code>        tv.tv_sec = waittime;
> code>        tv.tv_usec = 0;

Ah, that should be adjusted.

> Confirmation:
> :h ch_open
> doc>         waittime    Specify connect timeout as milliseconds.
> doc>                     Negative means forever.
> doc>                     Default: 0
> 
> What is the meaning of 0?
> Infinite wait? or polling?

No wait.

> When `waittime` is set to 0, Current source code has become a polling 
> (nowait).
> It's not useful.

The zero is useful when the server is supposed to be running already.
If not then it should fail immediately.  Can also be used like this:

        let handle = ch_open(address)
        if handle < 0
           !start_job
           let handle = ch_open(address, {'waittime': 1000})
        endif

-- 
hundred-and-one symptoms of being an internet addict:
156. You forget your friend's name but not her e-mail address.

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