I have a simple server that creates a thread on an accept. At the accept I create a thread that reads from the socket and does a command, after the command I detach the thread and clean up all the variables, thread finished. back in the main thread I am still waiting for the next accept. On recieving the next accept I have lost a dll that is loaded initialy as part of a use of a module.
so the question is why does it lose the module and what can I do about reloading it, ect.
this is the error that I get on when the second set of threads are created.
0: thread connect Connection Status = Connected (8192) Hangup start Hangup completed successfully 1: thread connect thread failed to start: Win32::RASE: RasDial not found in rasapi32.dll at thread_check.pl line 24 Hangup start thread failed to start: Win32::RASE: RasHangUp not found in rasapi32.d +ll at thread_check.pl line 41
use IPW::NET::Modem; use threads; use threads::shared; my $cxnid; share($cxnid); my $l = shift; for ( my $i = 0; $i < $l ; $i++ ) { print "$i:\n"; threads->create( \&threadConnect )->detach; sleep 30; #give the modem time to connect threads->create( \&threadDisconnect ); sleep 20; #give the modem time to disconnect } sleep 40; sub threadConnect { print "thread connect\n"; $cxnid = Win32::RASE::RasDial("UE01", undef, "jwetherill", "abc123 +", undef, undef); if ( !$cxnid ) { print "Failed to connect\n"; } else { sleep 15; ( $status, $statustext ) = Win32::RASE::RasGetConnectStatus($c +xnid); print "Connection Status = $statustext ($status)\n"; } threads->self->detach; } sub threadDisconnect { print "Hangup start\n"; if ( Win32::RASE::RasHangUp($cxnid, 30) ) { print "Hangup completed successfully\n"; } else { print "Hanging up all active connections\n"; Win32::RASE::HangUp(); } threads->self->detach; }
edit (broquaint): added formatting
edit (holli): added readmore tags
In reply to loss of dll in a multi threaded app by jwetherill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |