Giter VIP home page Giter VIP logo

Comments (7)

ethouris avatar ethouris commented on June 1, 2024

I have a bad feeling about this :). The trick here is that the file: scheme is standardized, whereas pipe: isn't. I know, srt: isn't standardized either, but in this case it's our specific protocol, only to be widespread, whereas pipes are used everywhere in the world. Not sure how others are using pipes if this needs to be specified in the URI, but I haven't found anyone using pipe: scheme and all searches redirect me to file://.

One extra problem with pipe:5 is that UriParser will parse it as scheme="" host="pipe" port="5". The application still can distinguish it as a special case, but it's kinda clumsy.

In stransmit I simply used the standard file scheme with con as a special-case host specification, in which the path part isn't used. If this is about providing ability to use other descriptors than default 0 and 1, I think it should be possible to simply add support for this within the current specification, where the descriptor would be extracted from the path part in the URI - for example: file://con/5.

(Note that may be nonportable - in stransmit there's currently used cin and cout directly - see ConsoleSource and ConsoleTarget classes. There's no portable way to use any "numeric file descriptor" in standard C++, so this would have to be probably a POSIX-only feature.)

Note that I haven't tested using file:///dev/stdin as source, nor did I experiment with file:///proc/self/fd/... :)

from srt.

ReubenM avatar ReubenM commented on June 1, 2024

The only use of a pipe: URI being used that I'm familiar with is within ffmpeg. But that project has quite a few custom URIs for all the protocols and IO devices it supports.

Documantation
Pipe Class

from srt.

ethouris avatar ethouris commented on June 1, 2024

Well, would be nice to have some standard for pipes, however it better be portable and coexist with some other standards - and just using 0 1 and 2 is already POSIX-specific.

from srt.

ReubenM avatar ReubenM commented on June 1, 2024

How would UriParser parse
pipe://./#5

If I understand the URI spec correctly it should be
scheme="pipe" host="localhost" path="/" fragment="5"

Where you could then use the fragment to specify the fd on a POSIX system and win32 could just ignore the fragment

from srt.

ReubenM avatar ReubenM commented on June 1, 2024

Though I'm not sure authority is really needed. It might work just as well with pipe:/#5

from srt.

ethouris avatar ethouris commented on June 1, 2024

from srt.

ethouris avatar ethouris commented on June 1, 2024

Need some clear statement as to whether "pipe://5" or "pipe://#5" form is worth adding.

from srt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.