Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
First off, that seems to presume that you have a unix handy to check on the system call.

There are lots of webpages out there to look up man pages, such as

No manual entry for send in section 2

On Debian-based systems like Ubuntu, there's a package manpages-dev that contains these man pages.

timeout mechanism

In my experience this can be accomplished with e.g. select (the multi-arg version), or the slightly higher-level IO::Select.

However, send and select are relatively low-level. Over time I've become more and more convinced that really the best way to do any communication with a delay is an asynchronous event-based system, of which select(2) is only the simplest. It takes a little getting used to, but it solves so many of the problems that synchronous code can suffer from that IMHO it's worth it. For example, I've used POE successfully (it has a bit of a learning curve but there's a cookbook), and recently I've been doing more with Mojolicious, and you can use its Mojo::IOLoop::Client and Mojo::IOLoop::Stream to implement a TCP client (Update: I posted an example here). If you were to show some example client code I might have the time to show what they would look like in Mojo.

In reply to Re: IO::Socket tutorial by haukex
in thread IO::Socket tutorial by BernieC

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2021-05-19 02:38 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (186 votes). Check out past polls.