Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: what else from port ?

by Corion (Patriarch)
on Jul 17, 2012 at 07:15 UTC ( [id://982158]=note: print w/replies, xml ) Need Help??


in reply to what else from port ?

If you want to communicate between running processes, perlipc lists about all of the available things. On Windows, you can also look at Win32::Pipe for a mailbox approach, and to Windows Messages if your program has some kind of GUI. But in the end, TCP is one of the well-proven approaches.

Replies are listed 'Best First'.
Re^2: what else from port ?
by exilepanda (Friar) on Jul 18, 2012 at 01:44 UTC
    Thanks a lot!! The Pipe thing looks an easy and clean one for me to start with. But do you suggest the TCP approach is better/safer than those pipe stuff ?

      Personally, I try to avoid IPC. If IPC is necessary, I use either files in a directory, a database or TCP, mostly in that order. Files in a directory have the nice advantage that I only need to worry about the server or the client and can manually test things by moving files into the watched directory. A database is good for serializing access if I have more than one watcher for a resource and they all want to grab the same resource/task. I use TCP servers only if I already do some other TCP interaction, like HTTP requests or talking to a mail server etc.. All these approaches are (fairly) network transparent in the sense that as long as the directory is mounted everywhere, the processes can even run on different machines.

      A Win32::Pipe has the advantage of being manually testable because you can copy files to \\.\pipe\yourpipename and your server can easily find out whether it has been started already. It only allows communication in the direction from the client to the server (I think), but you don't have much buffering problems. Using Win32::Pipe isn't that network transparent unless you have administrator privileges and can set up the users so that they are allowed to access \\machine\pipe\yourpipename from other machines.

      I haven't done much with pipes, and I find the file-based approach to be the simplest approach, so I would start that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://982158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-23 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found