> -----Message d'origine----- > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Envoyé : mardi 29 mars 2005 16:48 > À : Peter Rabbitson > Cc : beginners@perl.org > Objet : Re: simple server app > > > > ----- Original Message ----- > From: Peter Rabbitson <[EMAIL PROTECTED]> > Date: Tuesday, March 29, 2005 5:04 am > Subject: simple server app > > > Hi everyone, > Hello, > > >Here is my situation. I have a windows system which > > continuoslyruns a perl script, which utilizing Win32::Process and > > Win32::Setupsup is > > controlling a windows only app and when triggered makes it spit > > export files > > to a samba network share. From there on my main process which runs > > off a CGI > > under linux uses those files for internal purposes and so on and > > so forth. I > > would like to be able to trigger all exports remotely from the linux > > machine. In order to do this I need to communicate 4 strings to > > the process > > running on the windows machine. No information should be returned > > back,except maybe a 0/1 flag signifying failure/completion. I > > looked into SOAP > > and since I am not running Apache or IIS or anything else on the > > windows box > > for increased stability I started thinking about something like > > SOAP::Transport::TCP (not much docs to look at unfortunately). It > > seems to > > be able to do the job, however I feel it is an overkill for > > communicating 4 > > strings one way and 1 string the other way... I would appreciate > > if more > > seasoned programmers share suggestions on how would they approach > > such a > > problem (maybe there is something way simpler than SOAP that I > > simply do not > > know about). > If it's just a bit of data exchange you can use a simple server to > accomplish this task, and possibly build your own protocol for data > exchange. Below is a simple server example. > > #!PERL > > use warnings; > use strict; > use IO::Socket::INET; > $|=1; > my $sock = IO::Socket::INET->new( Listen => 5, > LocalAddr => '127.0.0.1', > LocalPort => 9000, > Proto => 'tcp') or die "ERROR: $!\n"; > > > if( my $session = $sock->accept() ){ > > print "connection from: ",$session->peerhost,"\n"; > my $msg=<$session>; > print "Received: $msg"; > } > else{ > die "Error on Socket $!\n"; > } > > > > > > Thank you > your welcome, hope it helps let us know if you have more issue's at hand. > Mar G. > > >
+1 I second this approach. Going for the full RPC::XML (or SOAP::Lite) just to exchange 4 strings seems an overkill to me. You don't need HTTP transport since I suppose your two boxes (Linux and Windows) belong to the same LAN ... A simple server like the one suggested here should be enough. Just my 0.02 BR, José. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>