Wiggins has asked for the wisdom of the Perl Monks concerning the following question:

I have spent the past 2 days searching for wisdom in history and the google, but must be using the wrong phrases, and possibly mixed concepts.

That which I wish, is to open a TCP socket in a fashion so that my select() fires only upon an end-of-line and returns 'cooked' (as in tty line cooked, (backspaces processed, stty stuff) data.

I think 'cooked' means something different to sockes and protocol levels being removed or retailed.

I remember something in Solaris when it first came out pushed processing units into a channel or something.

Do I have to write that processing myself and do one-at-a-time character reads from the socket? Or at a minimum the buffering and cooking?

It is always better to have seen your target for yourself, rather than depend upon someone else's description.

Replies are listed 'Best First'.
Re: line-at-a-time socket selects
by BrowserUk (Patriarch) on Jul 08, 2013 at 18:04 UTC
    That which I wish, is to open a TCP socket in a fashion so that my select() fires only upon an end-of-line

    It doesn't work that way. Its either/or

    1. Blockng sockets and readline and have the system find the newlines.

      (And threads to handle multiple concurrent conversations.)

    2. Non-blocking sockets and select and sysread and buffer the data as it arrives and break it into lines yourself.

    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: line-at-a-time socket selects
by zwon (Abbot) on Jul 09, 2013 at 16:41 UTC
    select doesn't process or analyse data in any way. You can buffer and split incoming data into lines yourself or use something like AnyEvent::Handle