in reply to Re^7: Non closing sockets - threads
in thread Non closing sockets - threads

Hello BrowserUk,

Thanks again for your help!
I like your code very much and will try to find out why is "Not a GLOB reference" error coming.
If you have some more ideas, will be welcomed!

Just an update!

I commented out $unitID and the error has gone.

threads->create( $peerhost = '127.0.0.1' ? \&cmdClient : \&gprsClient, # $unitId = 437918234 ? \&cmdClient : \&gprsClient, $client, $unitId )->detach;
Best regards, Igor

Replies are listed 'Best First'.
Re^9: Non closing sockets - threads
by BrowserUk (Patriarch) on Dec 17, 2008 at 13:02 UTC
    Just an update! I commented out $unitID and the error has gone.

    Gah! I cannot believe I left that in. And uncommented. Because all my test clients run locally, I had to find another way of distinguishing gprs from cmd client. So I used a hardcoded unitID.

    The two conditional lines are intended to be either/or, your system or mine.

    Does it now work? (Except for exhibiting the same failure to disconnect problem!)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Hello :) ,

      It's working, but both clients (localhost and gprs) executes cmdClient, gprsClient is not used.

      Correction - it is all correct!
      I'll do some tests now

      Gprs clients perfectly connects to the server and keep sending data.
      Localhost client does not execute commands and just closes itself, even if there are some gprs clients connected.
      If there is no connection, for I guess 500 sec, server closes itself.
      And at last, on clients abnormal disconnection, threads remain connected.

      Servers echo:

      gprsClient [4227801339] running on 4 4227801339: Command response: data test gprsClient [4227801339] running on 5 4227801339: Command response: data second client gprsClient [4227801339] running on 6 4227801339: Command response: data third client Command Client running on 7 cmdClient [859189299] disconnected
      If you have some more suggestions, I would really appreciate!

      Regards, Igor

        Did you see my /msgs requesting that we take this offline?