GithubHelp home page GithubHelp logo

About _Server.Stop() about supersimpletcp HOT 5 OPEN

FreeVB avatar FreeVB commented on June 11, 2024
About _Server.Stop()

from supersimpletcp.

Comments (5)

FreeVB avatar FreeVB commented on June 11, 2024
private void PrintServeLog(string msg)
{
    try
    {
        if (uiListBoxServe.Items.Count > 1000)
        {
            if (uiListBoxServe.InvokeRequired)
            {
                uiListBoxServe.BeginInvoke(new Action(() => uiListBoxServe.Items.Clear()));
            }
            else
            {
                uiListBoxServe.Items.Clear();
            }
        }

        if (uiListBoxServe.InvokeRequired)
        {
            uiListBoxServe.BeginInvoke(new Action(() => uiListBoxServe.Items.Insert(0, msg)));
        }
        else
        {
            uiListBoxServe.Items.Insert(0, msg);
        }
    }
    catch (Exception ex)
    {
        if (uiListBoxServe.InvokeRequired)
        {
            uiListBoxServe.BeginInvoke(new Action(() => uiListBoxServe.Items.Insert(0, "错误:" + ex.Message)));
        }
        else
        {
            uiListBoxServe.Items.Insert(0, "错误:" + ex.Message);
        }
    }
}

I tried using this method so that the UI doesn't respond to the problem solving, but _Server doesn't stop, but instead returns an error like this: System Net Sockets SocketException (995): I/O operation aborted due to thread exit or application request.

from supersimpletcp.

FreeVB avatar FreeVB commented on June 11, 2024

Unless I add to Task AcceptConnections(). ||ex is SocketException no longer gives the error message, but I'm not sure if that's right.

from supersimpletcp.

jchristn avatar jchristn commented on June 11, 2024

Hi @FreeVB thanks for your note. I'm sorry but I'm not fully understanding what the issue is that you are encountering. Could you try to describe it again?

from supersimpletcp.

FreeVB avatar FreeVB commented on June 11, 2024

Set PrintServeLog to _Server.Logger=PrintServeLog; , the service cannot be stopped. Or an error message appears.

from supersimpletcp.

jchristn avatar jchristn commented on June 11, 2024

@FreeVB Hi, this seems like an issue caused by the implementation using forms. Were you able to resolve it? Can you identify where it hangs, or, supply the error message that appears?

from supersimpletcp.

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.