Writing a server with node.js

General Discussion
  • Im trying to figure out how i can write a node.js server, BUT a server that is stable even when a high amount of users trying to connect. I want to write a server that can handle a big amount of users at the same time. The only thing i dont understand is how to handle multiple request at the same time. as far as i know node.js has multy threading but its limitted. Is there any other way i dont know about? Im new to node.js and trying to figure out. It would be great if i could atleast understand how it works so i can reasearch more spesific. The best would be if i can handle thousends of users in a short period of time.

    can someone give me some advice? I would highly appreciate.
    Excuse my english im still learning.

    Hope to get some help,
    Olli

  • This forum is not a forum meant for general node discussion, but a form for the forum software "NodeBB".

    I suggest you try stack overflow or Reddit instead.

    Regardless, node.js uses asynchronous IO. This means that in a single thread it can handle many requests at once.

  • @PitaJ oh im so sorry. i thought this is also a node forum. Excuse me, but thanks for the help.


Suggested Topics


  • Link to open JS box

    General Discussion
    0 Votes
    6 Posts
    412 Views

    @pitaj I actually have that, but I want to be able to customize the button then .
    Basically I’m making a thank you page for people associated with my site. It shows there name and links for their social medias. I used custom emojis so that when you click on the icon it goes to their page.

    22C34977-1CAD-4DD5-A49D-9B8D1FA3784B.jpeg

    For Discord and Battle.net however, there are no websites or pages per profile, only a username with a user tag.

    What I was is to be able to click on them as links like the others but it actually stays in the page and just opens a dialogue with the user tag so I don’t have to have the user tag displayed there with them (not as neat nor cool).
    Again thanks.

    If I were to make a plugin like this @julian, how would I start with that?

  • 0 Votes
    2 Posts
    305 Views

    @yehonatan-albert Maybe you can enable guests to reply in manage > priveleges.

  • 0 Votes
    2 Posts
    295 Views

    Can you please share the server-side error? This client-side error is not something we can use, unfortunately.

  • 0 Votes
    1 Posts
    493 Views

    Hi,guys, I'm new to node.js and I have met some difficult problems. Now, I 'm writing a native abstraction for node.js to combine with my cpp code, which are some re-encapsulated function about OpenCV's camera calibration algorithm. The thing is I don't know how to convert opecv datatype to v8 datatype, such as std::vector<cv::Mat>,
    std::vector<std::vector<cv::Point2f>.
    I do know how to convert single cv::Mat datatype and a vector<Point2f> datatype to v8 Object, I`ll attach those code in the end, please give me some suggestion about how to convert vector<Mat> and vector<vector<Point2f>> to v8 object.
    if(info.Length()!=1) return;
    char buffer = node::Buffer::Data(info[0]->ToObject());
    size_t size = node::Buffer::Length(info[0]->ToObject());
    std::vector<char> src(buffer, buffer + size);
    std::vector<uchar> dst = new std::vector<uchar>();
    //do some thing with it
    //return
    info.GetReturnValue().Set(
    Nan::NewBuffer((char)dst->data(), dst->size(), png_delete_callback, dst).ToLocalChecked()
    );
    //**This is how to convert a cv::Mat to v8 buffer*/

    v8::Localv8::Object obj = Nan::Newv8::Object();
    Nan::Set(obj, Nan::New("x").ToLocalChecked(), Nan::New(pts[i].x));
    Nan::Set(obj, Nan::New("y").ToLocalChecked(), Nan::New(pts[i].y));
    Nan::Set(arr, i, obj);
    //vector<Point2f> to jsArray

  • 1 Votes
    13 Posts
    4k Views

    @julian Awesome, thank you.