The public nameserver idea was a good one, but alas my ISP required an IP address for external hosts.
So I used SOAP to take the db record on the client side, stick it into a data structure, send that over to ther server, recollect the data structure on the server side, then put it into MySQL over there. It works great.
Here is the code that does the job, in case anyone else can use it. In both cases it assumes that you supply a sub that converts the database record to/from a data structure and returns it to the client/server.
Keep yer stick on the ice...Steve
Client:
soapserver.cgi#!/usr/bin/perl -w use strict; use SOAP::Transport::HTTP; sub sendthread { my $id = shift; my $reply; my $servermsg; my $data = getfromdb($id); my $server = SOAP::Lite + -> uri('http://www.soaplite.com/Storeit') + -> proxy('http://your.ip.net/cgi-bin/soapserver.cgi', timeout => + 30); eval { $servermsg = $server->store($id,$data); }; if ($@) { # eval error $reply = $@; } elsif ($servermsg->fault) { # server fault $reply = join ', ', $servermsg->faultcode, $servermsg->faultstr +ing, $servermsg->faultdetail; } else { # everything OK $reply = $servermsg->result(); } return $reply; }
#!/usr/bin/perl -w use strict; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Storeit') -> handle; package Storeit; sub store { my ($class,$id,$data) = @_; my $response = storetodb($id,$data); return $response; }
In reply to Re^2: Sending Storable strings over http
by cormanaz
in thread Sending Storable strings over http
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |