Hi All,

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
this is the code that I am using to connect and diconnect a modem in a threaded model(simplified) ,
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.