Coder Social home page Coder Social logo

Make FD# configurable about socketmaster HOT 6 CLOSED

zimbatm avatar zimbatm commented on September 27, 2024
Make FD# configurable

from socketmaster.

Comments (6)

zimbatm avatar zimbatm commented on September 27, 2024

I don't think that it's true if the file descriptor already holds the position. I was running ruby processes with fd3 just fine at least. ?

from socketmaster.

owenthereal avatar owenthereal commented on September 27, 2024

Maybe I do not understand Unix enough. Why is fd3 so special?

from socketmaster.

owenthereal avatar owenthereal commented on September 27, 2024

Is it because the inherited socket file of socketmaster is the 3rd one here besides stdin, stdout & stderr?

from socketmaster.

zimbatm avatar zimbatm commented on September 27, 2024

It's not really special. FDs are allocated linearly so 3 is just the next FD after stdin (0), stdout (1) and stderr (2). Otherwise it's possible to select an arbitrary FD number using the dup2 syscall but I don't know if go provides that level of control for new processes.

You're welcome to try and submit a PR.

from socketmaster.

mikehale avatar mikehale commented on September 27, 2024

I don't think that it's true if the file descriptor already holds the position. I was running ruby processes with fd3 just fine at least. ?

Yeah, I see that the childserver.rb example works fine. I'm not sure exactly what I was trying before, but it seems like ruby and socketmaster work just fine with fd3.

Thanks, and sorry for the noise.

from socketmaster.

zimbatm avatar zimbatm commented on September 27, 2024

No worries, learning is good !

from socketmaster.

Related Issues (5)

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.