Vim script support of socket access or IPC (inter-process communication) ?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim script support of socket access or IPC (inter-process communication) ?

panshizhu
Hi,

For some reason I need to access some local service within vim, this can
be Unix socket (d-bus, x message, etc.) or TCP socket (http, ftp, etc.).

A typical example is an IM engine, which can provide service to both XIM
and vimim. The engine may need a relatively long start-up time to build
the cache and it only need to start once, while vim should start-up very
fast and run many times. Separate them may be a good idea.

I found nothing related to socket access or IPC feature in vim script so
I cannot do that from within vim script. Seek for python or perl support
is not an option here, since we should not add unnecessary dependency to
end-users.

Adding IPC support seems no problem for vim design philosophy, since
this enables vim interact with other applications better, instead of
incorporating other application features into vim itself.

Any hints?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

just-11


2009/12/15 pansz <[hidden email]>
Hi,

For some reason I need to access some local service within vim, this can
be Unix socket (d-bus, x message, etc.) or TCP socket (http, ftp, etc.).

A typical example is an IM engine, which can provide service to both XIM
and vimim. The engine may need a relatively long start-up time to build
the cache and it only need to start once, while vim should start-up very
fast and run many times. Separate them may be a good idea.

I found nothing related to socket access or IPC feature in vim script so
I cannot do that from within vim script. Seek for python or perl support
is not an option here, since we should not add unnecessary dependency to
end-users.

Adding IPC support seems no problem for vim design philosophy, since
this enables vim interact with other applications better, instead of
incorporating other application features into vim itself.

Any hints?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Aout the tcp sock,vim can do it whit the help of netrw.vim plugin
But i suggest that you should download the newest form the writer's website
here is the address:
In his website ,you will find netrw.vim and other useful plugin 
Have fun.


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

panshizhu
just 写道:

>> I found nothing related to socket access or IPC feature in vim script so
>> I cannot do that from within vim script. Seek for python or perl support
>> is not an option here, since we should not add unnecessary dependency to
>> end-users.
>>
>> Adding IPC support seems no problem for vim design philosophy, since
>> this enables vim interact with other applications better, instead of
>> incorporating other application features into vim itself.
>>
>> Any hints?
>
> Aout the tcp sock,vim can do it whit the help of netrw.vim plugin

netrw plugin uses external program to do the network access, hence
introducing new external dependencies.

a standard windows version of gvim cannot use most features of netrw,
unless you installed those external programs.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

Charles Campbell
pansz wrote:

> just 写道:
>  
>>> I found nothing related to socket access or IPC feature in vim script so
>>> I cannot do that from within vim script. Seek for python or perl support
>>> is not an option here, since we should not add unnecessary dependency to
>>> end-users.
>>>
>>> Adding IPC support seems no problem for vim design philosophy, since
>>> this enables vim interact with other applications better, instead of
>>> incorporating other application features into vim itself.
>>>
>>> Any hints?
>>>      
>> Aout the tcp sock,vim can do it whit the help of netrw.vim plugin
>>    
>
> netrw plugin uses external program to do the network access, hence
> introducing new external dependencies.
>
> a standard windows version of gvim cannot use most features of netrw,
> unless you installed those external programs.
>
>  
Netrw does provide an interface for vim to several external programs
which make file transfer/browsing possible.  IMHO, the notion that vim
would incorporate its own code to do zip, gzip, tar, ftp, ssh, etc
internally is unrealistic.

Regards,
Chip Campbell

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

Sergey Khorev
In reply to this post by panshizhu
> be Unix socket (d-bus, x message, etc.) or TCP socket (http, ftp, etc.).

Locking on platform-specific stuff like dbus, you effectively lose one
of the main Vim advantages: its multiplatformness.
Designing some sort of universal IPC mechanisms would be quite challenging task.

> Adding IPC support seems no problem for vim design philosophy, since
> this enables vim interact with other applications better, instead of
> incorporating other application features into vim itself.

Vim is single-threaded application. If you want to implement proper
IPC, for instance, Vim waiting on some event, you will need to rewrite
much of its core I'm afraid.

--
Sergey Khorev
http://sites.google.com/site/khorser
Can anybody think of a good tagline I can steal?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

panshizhu
Sergey Khorev 写道:
> Vim is single-threaded application. If you want to implement proper
> IPC, for instance, Vim waiting on some event, you will need to rewrite
> much of its core I'm afraid.

What if I can expect my communication to respond immediately?

Anyway, we can define a timeout, for single-direction or non-blocking IPC .

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

Tony Mechelynck
In reply to this post by panshizhu
On 15/12/09 03:30, pansz wrote:

> Hi,
>
> For some reason I need to access some local service within vim, this can
> be Unix socket (d-bus, x message, etc.) or TCP socket (http, ftp, etc.).
>
> A typical example is an IM engine, which can provide service to both XIM
> and vimim. The engine may need a relatively long start-up time to build
> the cache and it only need to start once, while vim should start-up very
> fast and run many times. Separate them may be a good idea.
>
> I found nothing related to socket access or IPC feature in vim script so
> I cannot do that from within vim script. Seek for python or perl support
> is not an option here, since we should not add unnecessary dependency to
> end-users.
>
> Adding IPC support seems no problem for vim design philosophy, since
> this enables vim interact with other applications better, instead of
> incorporating other application features into vim itself.
>
> Any hints?
>

Vim already includes (if compiled with the proper features) two
mechanisms for inter-process communication:

- client-server operation (on both X11 and Windows)
        :help remote.txt
- OLE (Windows only)
        :help if_ole.txt

Best regards,
Tony.
--
I'm going to Boston to see my doctor.  He's a very sick man.
                -- Fred Allen

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

panshizhu
> Vim already includes (if compiled with the proper features) two
> mechanisms for inter-process communication:
>
> - client-server operation (on both X11 and Windows)
>     :help remote.txt

This is only available for

X11 gui
console vim with X11 support
Windows gui

This does not work for:

console vim without X11 support (the most wide-spread version)
win32 console version of vim


> - OLE (Windows only)
>     :help if_ole.txt


It helps when it is more cross-platform.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

Tony Mechelynck
Sorry for this late answer

On 03/02/10 09:41, pansz wrote:

>> Vim already includes (if compiled with the proper features) two
>> mechanisms for inter-process communication:
>>
>> - client-server operation (on both X11 and Windows)
>> :help remote.txt
>
> This is only available for
>
> X11 gui
> console vim with X11 support
> Windows gui

Windows console

>
> This does not work for:
>
> console vim without X11 support (the most wide-spread version)

True; but you can always use gvim -v (if you have a GUI version
installed and, of course, X11 started and available, as in an xterm) as
a console-mode Vim on Unix/Linux. If you compile Vim yourelf (a practice
which is quite "widespread" on Unix/Linux AFAIK) it will usually be a
GUI-enabled version doing double duty as both vim and gvim (and view,
gview, etc.), so it will have X11 support.

> win32 console version of vim

False, see :help w32-clientserver

>
>
>> - OLE (Windows only)
>> :help if_ole.txt
>
>
> It helps when it is more cross-platform.
>

Best regards,
Tony.
--
"Intelligence has much less practical application than you'd think."
           -- Scott Adams, Dilbert.

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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Reply | Threaded
Open this post in threaded view
|

Re: Vim script support of socket access or IPC (inter-process communication) ?

iler.ml
You can access sockets API via perl interface that vim has.

Yakov

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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.