News for hackers. Stuff that matters.
Re:Adapting Plan 9's listen to GNU Guix by tmtvl on Friday October 11, 2024 @02:00PM (#41811690)
> Network services are defined by the presence, in a directory watched by listen, of executable files whose name is of the form <protocol><port>.

That seems a bit silly to me as it means something like rot1376 is tricky to parse correctly. I'd think it would make sense for the protocol to need to be separated from the port by a non-numeric character, like a hyphen. Like that it would be trivial to parse: just grab all the numeric characters from the end until we find the non-numeric character.

Re:Adapting Plan 9's listen to GNU Guix by msk-lywenn on Tuesday October 15, 2024 @01:28PM (#41850884)
Rot13 is not a protocol. If you want to make a rot13 over tcp on port 13, your executable would be named tcp13. I thought the same mistake at first too.
Re:Adapting Plan 9's listen to GNU Guix by PeterWhittaker on Tuesday October 15, 2024 @01:35PM (#41850962)
Honesty, that’s trivial to parse, even if you don’t want to use or don’t have regex available: In C, e.g., just treat the name as a string and walk backwards from the last character until you find a non-digit; adjust for indexing, and you now know where the protocol ends and port begins.
Re:Adapting Plan 9's listen to GNU Guix by mecsred on Tuesday October 15, 2024 @02:37PM (#41851672)
That explicitly wouldn't work in the example you're responding to
Re:Adapting Plan 9's listen to GNU Guix by dpassens on Tuesday October 15, 2024 @02:04PM (#41851266)
I believe GP meant that you can't have protocols containing numbers, using rot13 as the example protocol on port 76. Though, as msk-lywenn said, rot13 isn't a real protocol, which don't really have numbers in their names.
Re:Adapting Plan 9's listen to GNU Guix by KerrAvon on Tuesday October 15, 2024 @02:50PM (#41851839)
rotthirteen76 would work
Re:Adapting Plan 9's listen to GNU Guix by greyfade on Tuesday October 15, 2024 @06:15PM (#41853669)
rotthirteen would "work", but it's not a protocol.

Actual protocols include tcp, udp, dccp, sctp, etc.

Re:Adapting Plan 9's listen to GNU Guix by phlip9 on Tuesday October 15, 2024 @05:25PM (#41853284)
Exactly, it should use a separator. Consider a more realistic example, like http280 or h3443. Totally ambiguous.
Re:Adapting Plan 9's listen to GNU Guix by linschn on Tuesday October 15, 2024 @06:15PM (#41853668)
True, and noted, but realistically, the only implemented protocol now is tcp, and the next one will be udp.

Historically, Plan 9 had IL as well.

Which transport protocol has a number in its name ?

If I implement one someday I'll add a separator.