|
From: Christian M. <ma...@ma...> - 2007-10-01 08:30:12
|
Please ignore my last post...
I have updated the swig-api again, and I added a new function
closeconnection(). This could be called if you want to call init() multiple
times. The name of the function may change if we find a better name for
it... just wanted to warn you about it.... :)
OW::finish() should only be called once in the end to free up all memory.
#!/usr/bin/perl
use OW ;
OW::init("u");
print "Init done\n";
my $BusData = OW::get("/");
print "Busdaten: $BusData\n";
OW::closeconnection();
print " closeconnection\n";
sleep 2;
OW::init("--fake 10");
print "Init done\n";
my $BusData = OW::get("/");
print "Busdaten: $BusData\n";
OW::closeconnection();
print " closeconnection\n";
sleep 2;
OW::init("192.168.3.1:3002");
print "Init done\n";
my $BusData = OW::get("/");
print "Busdaten: $BusData\n";
OW::closeconnection();
sleep 2;
OW::finish();
print " OWFinish\n";
|