[{"data":1,"prerenderedAt":259},["ShallowReactive",2],{"project-16727946":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":35,"aspects":36,"strip":41,"post_text":43,"what":44,"said":54,"maker_in_thread":135,"shape":146,"grid":150,"attempts":222,"same_week":223,"maker_shows":202,"maker_hidden":252,"reader_version":253,"card":254},"16727946","Moustique","C++14 coroutine-based non-blocking IO on Linux","title","Show HN: Moustique – C++14 coroutine-based non-blocking IO on Linux","https:\u002F\u002Fgithub.com\u002Fmatt-42\u002Fmoustique","github.com","matt42",1522586253,2018,68,31,629,2155,30,"notable","languages","c++ networking library","library",[24,25,26,27,28],"c++14","coroutines","non-blocking io","linux","tcp server","roasted",-0.35,{"positive":32,"neutral":33,"mixed":32,"critical":34},1,2,5,9,{"execution":37,"design":39,"docs":40},{"positive":38,"critical":32},0,{"positive":32,"critical":33},{"positive":38,"critical":33},[42,38,38,38,38,38,38,38,38,42,38,32,38,38,34,38,32,38,38,38,38,32,38,32,32,38,38,38,38,38,42],3,null,{"problem":43,"audience":43,"pricing":43,"motivation":43,"time_to_build":43,"stack":45,"openness":52,"stage":53,"team_size":52},[46],{"value":47,"source":48,"evidence":49},"C++14","maker",[50],{"id":51},"post","unknown","launched",{"praise":55,"objections":64,"requests":93,"questions":115,"alternatives":127},[56],{"value":57,"source":58,"evidence":59},"Great project, commenter plans to try it","commenter",[60],{"id":61,"by":62,"text":63},"16729601","primitur","While you're at it please add a namespace .. it'd make it a lot easier to administer in a project. Great project by the way - I've put it on my workbench-TODO for a little…",[65,72,79,86],{"value":66,"source":58,"evidence":67},"README has spelling and language issues",[68],{"id":69,"by":70,"text":71},"16729608","notfed","Since you asked, I suggest running your readme through a spell checker. I didn't bother looking further than that.",{"value":73,"source":58,"evidence":74},"Only a TCP client; claims of Linux I\u002FO overstated",[75],{"id":76,"by":77,"text":78},"16729031","ac_slater","Not super fair to say linux sockets (in the README) and I\u002FO in the title when it's really just a TCP client - you force SOCK_STREAM and bind(2).",{"value":80,"source":58,"evidence":81},"API port and fd arguments easily confused",[82],{"id":83,"by":84,"text":85},"16729361","petters","This is the API: int moustique_listen(const char* port, G closed_connection_handler, H data_handler); int moustique_listen(int listen_fd, G closed_connection_handler, H…",{"value":87,"source":58,"evidence":88},"Memory and resource leaks",[89],{"id":90,"by":91,"text":92},"16729861","SamReidHughes","You've got memory leaks and resource leaks there.",[94,109],{"value":95,"source":58,"evidence":96},"Use namespaces",[97,101,105],{"id":98,"by":99,"text":100},"16729459","Koshkin","> moustique_listen What, no love for namespaces?",{"id":102,"by":103,"text":104},"16729848","w8rbt","It's just more C++ ish to write something::listen rather than something_listen. Namespaces are easy too. Why not?",{"id":106,"by":107,"text":108},"16730289","RotsiserMho","I would. Both because it's more idiomatic and because it's inevitable more functions will be added.",{"value":110,"source":48,"evidence":111},"Separate TCP and UDP listen helpers",[112],{"id":113,"by":11,"text":114},"16729139","But you're right, maybe we want two moustique_listen_tcp moustique_listen_udp helpers. I put this in my todolist.",[116],{"value":117,"source":58,"evidence":118},"Whether fd storage should be unordered_map or vector",[119,123],{"id":120,"by":121,"text":122},"16729285","Const-me","I haven’t developed much for Linux, but I think it’s a good idea to replace your std::vector\u003Cctx::continuation> fibers with std::unordered_map\u003Cint, ctx::continuation> fibers.…",{"id":124,"by":125,"text":126},"16730528","noselasd","Note that the stackoverflow post does not technically apply. accept() finds the smalles available file descriptor - it will never suddenly hand you a file descriptor of a huge…",[128],{"value":129,"source":58,"evidence":130},"Boost ASIO with Boost coroutines",[131],{"id":132,"by":133,"text":134},"16730547","Matthias247","Please be fair if in the readme that a comparison to ASIO is a bit apples to oranges. This one seems to be mostly a learning project, and is heavily work in progress. boost asio…",{"comments":35,"answered":33,"key":136},[137,140,143],{"id":138,"text":139},"16742743","I'll try and swith to unordered_map if it has a negligible impact on performances.",{"id":141,"text":142},"16752842","Removed the comparison with ASIO. But note that this is not \"heavily in progress\" but ready for production too. I took your remark for the closing callback. read now returns 0…",{"id":144,"text":145},"16729108","This is default behaviour but you can fill you own socket file descriptor if you want, using the second overload of moustique_listen: template \u003Ctypename G, typename H> int…",{"commenters":147,"max_depth":34,"maker_replies":35,"first_comment_mins":148,"lifespan_hours":149},18,222,67,[151,153,155,157,159,162,164,166,169,172,174,176,178,180,181,183,186,188,191,195,198,201,204,206,208,209,213,216,218,219,221],[120,38,42,152,121,38],"maker\u002Fneutral\u002Fexecution",[124,38,38,154,125,38],"commenter\u002Fneutral\u002Fnone",[156,38,38,154,121,38],"16730747",[138,38,38,158,11,32],"project\u002Fneutral\u002Fperformance",[160,38,38,154,161,38],"16730677","drfuchs",[163,38,38,154,121,38],"16730770",[165,38,38,154,161,38],"16731201",[167,38,38,154,168,38],"16731557","gravypod",[170,38,38,171,121,38],"16734010","other\u002Fneutral\u002Fnone",[132,32,42,173,133,38],"project\u002Fmixed\u002Fdesign",[141,32,38,175,11,32],"project\u002Fneutral\u002Fexecution",[76,33,32,177,77,38],"project\u002Fcritical\u002Fdocs",[144,33,38,179,11,32],"project\u002Fneutral\u002Fdesign",[113,33,38,179,11,32],[61,33,34,182,62,38],"project\u002Fpositive\u002Fdesign",[184,42,38,185,11,32],"16729302","maker\u002Fneutral\u002Fnone",[69,42,32,187,70,38],"maker\u002Fcritical\u002Fdocs",[189,42,38,154,190,38],"16729763","bjoli",[192,42,38,193,194,38],"16730277","commenter\u002Fneutral\u002Fdocs","krotton",[196,42,38,197,11,32],"16743321","maker\u002Fneutral\u002Fdocs",[199,42,38,154,200,38],"16731060","nitely",[90,202,32,203,91,38],4,"project\u002Fcritical\u002Fexecution",[205,202,38,175,11,32],"16743315",[83,34,32,207,84,38],"project\u002Fcritical\u002Fdesign",[98,34,32,207,99,38],[210,34,38,211,212,38],"16729628","commenter\u002Fneutral\u002Fdesign","wyldfire",[214,34,38,215,11,32],"16729751","maker\u002Fneutral\u002Fdesign",[217,34,38,211,99,38],"16729844",[102,34,38,211,103,38],[220,34,38,179,11,32],"16742734",[106,34,42,179,107,38],[],[224,229,234,238,243,248],{"id":225,"name":226,"points":227,"category":228},"16754987","zero-width-chrome-extension",385,"dev_tools",{"id":230,"name":231,"points":232,"category":233},"16706666","text2mindmap",323,"productivity",{"id":235,"name":236,"points":237,"category":233},"16743030","“Who is hiring",255,{"id":239,"name":240,"points":241,"category":242},"16742492","Alpaca My Bags",238,"consumer_social",{"id":244,"name":245,"points":246,"category":247},"16721831","Auditus",146,"creative",{"id":249,"name":250,"points":251,"category":20},"16719648","ShivyC",120,false,"v2",{"id":255,"name":5,"line":6,"ai":252,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":256,"maker":11,"domain":10,"tier":19,"attempts":38,"strip":257,"url":9,"mix":258,"praise":57,"objection":66,"sub":21},16727946,[24,25,26,27,28],"3000000003010050100001011000003",[32,33,32,34],1794036564695]