From: Martin B. <mb...@ib...> - 2005-05-05 15:22:58
|
Hi, This is my first app with POE, it seems a logical progression from Net::EasyTCP (which is excellent btw), and adds more functionality. Net::EasyTCP can't handle setcallbacks for the client, hence the move to POE. I have a very simple client and server, which connect to each other, and subsequent clients can see those connections as well, but I am slightly confused with Loop, and how to set it up. The example included with POE::Loop::Wx is fairly complex (for me), so a minimal version would be ideal for starters. I don't really want to post my existing wx/Net::EasyTCP example, as the client is around 1000 lines of code. It simply issues commands to a server, waits for a return (text or html), then displays it. So it's ideal to control applications without the need to log into a server, but it's incapable of receiving adhoc messages. Once I have a basic minimal wx chat client/server, I'll post them back as an example. Thanks Martin -----Original Message----- From: Mike Schroeder [mailto:MikeSchroeder@DonorWare.com] Sent: 05 May 2005 15:50 To: Martin Bower Cc: wxp...@li... Subject: Re: [wxperl-users] do I need to use POE::Loop::Wx ? If you want the Wx loop and the POE loop to co-exist in the same process, then you need to use POE (to the best of my knowledge). I don't use Net::EasyTCP, but I looked at the docs for it, and the whole idea of setcallback() is *kinda* the same as POE. In POE, you will need to have a Session for PoCoCl::TCP which you configure for various states -- from the POD, it looks like the ServerInput state gets called every time you receive something -- I would start by trying to put your code in there. Is this your first POE app? If so, you may want to write a POE proof-of-concept to make sure you know what POE is doing before trying to marry Wx and POE. The two are powerful, but it helps to understand a bit each before combining them (speaking from experience). I'll try and send along a new minimalpoe.pl example later today to show how Wx and POE can cooperate. Feel free to send along an example of what you are trying to do... Mike Schroeder MikeSchroeder@DonorWare.com http://www.donorware.com ****************************************************************************** The information in this document, including any attachments or subsequent correspondence originating from this email address ("email"), is confidential and may be legally privileged. It is intended solely for the addressee. However, it may be intercepted by the system controller at Bankgesellschaft Berlin AG for the purposes of monitoring communications relevant to the system controller's business. Access to this email by anyone else is unauthorised. If you have received this email in error, please notify the Sender immediately by telephone. Please also delete this email from your computer. Any form of reproduction, dissemination, copying, disclosure, modification, distribution or publication of this email is prohibited without the prior consent of Bankgesellschaft Berlin AG. If you are not the intended recipient, any action taken or omitted to be taken in reliance of this email is strictly prohibited and may be unlawful. Bankgesellschaft Berlin AG accepts no liability for the consequences of any person acting, or refraining from action in reliance of this email ****************************************************************************** |