motzi has asked for the wisdom of the Perl Monks concerning the following question:
So, in every thread i want to check if $mysocket is not a socket already before to create a new one. What method can i use?sub dbconnect { $mysocket = int rand 100; # (don't tell to use a bigger number please) socket($mysocket, PF_INET, SOCK_STREAM, getprotobyname 'tcp'); # ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detect socket
by ikegami (Patriarch) on Apr 21, 2010 at 20:58 UTC | |
by motzi (Sexton) on Apr 21, 2010 at 21:08 UTC | |
by ikegami (Patriarch) on Apr 21, 2010 at 21:11 UTC | |
by ikegami (Patriarch) on Apr 21, 2010 at 21:19 UTC | |
by apl (Monsignor) on Apr 22, 2010 at 12:20 UTC | |
|
Re: Detect socket
by BrowserUk (Patriarch) on Apr 21, 2010 at 23:12 UTC |