POE is fantastic for doing these sort of things. It has a steep learning curve, however. I can recommend the chapter on POE in "Advanced Perl Programming" by Simon Cozens (O'Reilly). But once you got the hang of it, it's much easier to write parallel/long-running applications with it compared to fork() or threads.
POE by itself has no GUI, but you can replace its own main loop by the main loop of (G)Tk, for example. | [reply] [d/l] |
If you want a simple GUI on Windows, I suggest Tk. Tk contains an "event-loop" so it can be used like POE. Here is a Tk client-server example. Start the server, then as many clients as you want. If you notice, there is a a separate entry box at the bottom of the client, so you can receive and send simultaneously. There are many, many variations on this type of example. The big distinction ( as you will learn as you delve into sockets) is that IO::Select uses a blocking mode. That is, for short messages it is fine, but if you transfer huge files, it will block others until the file transfer is complete. In those cases you want a forking or threaded server. Search for examples of them. For instance Sockets-File-Upload with Net::EasyTCP which uses the very handy Net::EasyTCP module.
| [reply] [d/l] [select] |
I'm not a Windows person, but I've noticed that there's a start command available in Windows for spawning a process - by default without wait. The two processes can communicate using Win32::Pipe - in the documentation mentally translate "server" into "parent" and "client" into "child" for your case.
__________________________________________________________________________________
^M Free your mind! | [reply] |
| [reply] |
I am sure the community would benefit from your explanation rather than just your conclusion (if you should have time?) - I got the idea of using Win32::Pipe from the big camel book chapter 16 - and I can't try it out at work because I am hired as a unix programmer and have a paranoically restrictive PC environment to contend with.
__________________________________________________________________________________
^M Free your mind!
| [reply] |
Take a look at Re: How to do simultaneous reads and writes to/from a socket?, it may give you some clues as to how to get started doing this with threads.
A word of warning though. If you are serious about using threads, upgrade from 5.8.0 to at least 5.8.4 and preferably later.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |