Coder Social home page Coder Social logo

Comments (7)

MrPeanutButta avatar MrPeanutButta commented on September 14, 2024

I need to find a way to correctly test on distributed servers. I'm seeing issues with spinning up multiple servers on a single machine. I think it's because of it's static and multi-threaded design.

from socket2me.

MrPeanutButta avatar MrPeanutButta commented on September 14, 2024

Tested with 3 servers. Fails over as expected.
NOTE: test servers tend to hang and not release sockets very well.

from socket2me.

WithFoxSquirrel avatar WithFoxSquirrel commented on September 14, 2024

hi, ahebet, thanks for your excellent work.
i have a question, i run the socket server, and then run a client connect to the socket server.
then i kill the client process, i found the server's memory is increasing fast.
i doubt there is memory leak when i kill the client, can you give me some clues ?
thank you very much !

from socket2me.

MrPeanutButta avatar MrPeanutButta commented on September 14, 2024

from socket2me.

MrPeanutButta avatar MrPeanutButta commented on September 14, 2024

@songbaoer or you can just send a pull request πŸ‘

from socket2me.

WithFoxSquirrel avatar WithFoxSquirrel commented on September 14, 2024

@ahebert , sorry for late reply,

1、i start a server like following:

` unique_ptr s(new server("vcm_plugin_auth", auth::MD5));

s->set_read_callback(server_receive);
s->listen("0.0.0.0", port);

while(1)
{
    this_thread::sleep_for(chrono::seconds(50));
}`

2、and then start a client without addfailover

` unique_ptr c(new client("vcm_plugin_auth", auth::MD5));

static int i = 0;

 while(!c->authenticate(ip_addr, port))
{
    cout<< "authenticate fail, please check the server ip and port is correct " << endl;

    client_s(to_string(++i));
    i = i < 10 ? i : 3;

    this_thread::sleep_for(chrono::seconds(kHeartBeatInterval));
};

do {

    while (c->connected()) 
    {

        auto uuid(c->getUUid());
		
		//do something
		
        this_thread::sleep_for(chrono::seconds(kHeartBeatInterval));
    }

    client_s(to_string(++i));
    i = i < 10 ? i : 3;

    this_thread::sleep_for(chrono::seconds(kHeartBeatInterval));

    cout << "attempting failover" << endl;

} while (c->failover());`

3、when i kill the client process , the server memory increasing fast ,
maybe i have wrong way to use your software, could you review my code,
and give me some advices? thanks a lot

from socket2me.

MrPeanutButta avatar MrPeanutButta commented on September 14, 2024

@songbaoer I've opened a new bug to track this. Please refer to #10 for this issue going forward.
I'll investigate this.

Thanks,
Aaron

from socket2me.

Related Issues (7)

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.