Sunday, February 3, 2019

Re: is channel can be opened on any tcp port ?

Le dimanche 3 février 2019 13:13:52 UTC+1, Bram Moolenaar a écrit :
> > I would like to know if we can use channel opening example on any server.
> >
> > For example this one : http://snap7.sourceforge.net/snap7_server.html
> > There is a demoserver which uses tcp port 102.
>
> Yes, that should work.
>
> --
> Why isn't there mouse-flavored cat food?
>
> /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///

Yes it works Fine. Thank you!


let s:destination="localhost:102"

func! testing#Handle(channel, msg)
echo 'Received: ' . a:msg
endfunc

fun! testing#Connect() "{{{
let g:channel = ch_open(s:destination, {"callback": "Handle", "mode": "raw", "waittime":"800"})
if ch_status(g:channel) == "open"
echo "channel in use"
else
echo "channel fails"
endif
endfunction "}}}

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: