Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Check connection state prior to send data

by BrowserUk (Patriarch)
on Sep 24, 2016 at 08:29 UTC ( [id://1172529]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Check connection state prior to send data
in thread Check connection state prior to send data

What you link is an interesting start point, but I already checked these pages without find a solution to my issue!

In what way is IO::Select::can_write( [ TIMEOUT ] ); not a solution to your issue?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: Check connection state prior to send data
by Lucas Rey (Sexton) on Sep 24, 2016 at 09:09 UTC
    Ok, maybe I don't understand how the IO::Select works. :(
    Could you please post an example on how I can implement it? Thank you!!

      Adapting the SYNOPSIS gives me the following code:

      use IO::Select; $s = IO::Select->new(); ... $s->add($some_handle); my $outbuffer; while( $running ) { if( length $outbuffer ) { my @writeable = $s->can_write($timeout); for my $client (@writeable) { print {$client} $outbuffer; # In reality, we'd need to maintain an outbuffer per c +lient, but # that's not the point here }; undef $outbuffer; } else { $outbuffer = refill_outbuffer; }; };

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1172529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found