• Maximum for gets

    From saito@saitology9@gmail.com to comp.lang.tcl on Mon Apr 28 15:32:25 2025
    From Newsgroup: comp.lang.tcl

    Is there a limit to the number of characters that gets can read at a time?
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Petro Kazmirchuk@vivid.tree7955@fastmail.com to comp.lang.tcl on Mon Apr 28 21:48:32 2025
    From Newsgroup: comp.lang.tcl

    On 28/04/2025 21:32, saito wrote:
    Is there a limit to the number of characters that gets can read at a time?

    in principle, it is limited only by the max length of Tcl string (~2GB
    in Tcl 8.6), that's why when using it with sockets, it is recommended to combine gets with [chan pending] to protect against malicious or
    misbehaving peer, see https://wiki.tcl-lang.org/page/chan+pending
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From saito@saitology9@gmail.com to comp.lang.tcl on Mon Apr 28 16:50:39 2025
    From Newsgroup: comp.lang.tcl

    On 4/28/2025 3:48 PM, Petro Kazmirchuk wrote:
    On 28/04/2025 21:32, saito wrote:
    Is there a limit to the number of characters that gets can read at a
    time?

    in principle, it is limited only by the max length of Tcl string (~2GB
    in Tcl 8.6), that's why when using it with sockets, it is recommended to combine gets with [chan pending] to protect against malicious or
    misbehaving peer, see https://wiki.tcl-lang.org/page/chan+pending

    Thank you for the tip. This is for a local script sending another some
    data via std channels. I was afraid that they might have a problem with
    data sizes around 5K :-)

    --- Synchronet 3.20c-Linux NewsLink 1.2