Git Product home page Git Product logo

Comments (5)

triforce avatar triforce commented on May 21, 2024

Do we need to use a shutdown before the sys_close call?

from asmttpd.

nemasu avatar nemasu commented on May 21, 2024

Ah my bad, I think instead of using shutdown, we just need to add the flag SO_REUSEADDR to the bind port.

from asmttpd.

triforce avatar triforce commented on May 21, 2024

So we will need a new syscall to SYS_SETSOCKOPT with rdx = SO_REUSEADDR after sys_create_tcp_socket.

The pointer to 1 might be an issue as the stack isn't setup the same as it is for the cork syscalls so may need to make use of some r registers to save the rbp/rsp?

from asmttpd.

nemasu avatar nemasu commented on May 21, 2024

I've changed it to use bss data instead of stack, and it's calling the correct functions successfully (SO_REUSEADDR), but I still get the bind error when I close it after a client connects.

from asmttpd.

nemasu avatar nemasu commented on May 21, 2024

Ah, I figured it out, need to call REUSEADDR before bind, not after. :)

from asmttpd.

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.