GithubHelp home page GithubHelp logo

dot_net_sdk's People

Contributors

nwlandry avatar shadow-cipher avatar wsobel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dot_net_sdk's Issues

Adapter unable to connect to multiple clients.

The steps:

  1. Adapter is running successfully and gathering data.
  2. Agent connects to the adapter and collects data as expected.
  3. A telnet to the adapter port rejects any connection.
  4. The telnet connects as soon as the agent is stopped.

I think that the additional clients are in a queue till the connected client thread is terminated. Ref

Have tried to test the following code and seems to work. Please review.

private void HeartbeatClient(object client)
        {
            ...
            // Send intial stream to the client
            SendAllTo(clientStream);
            ...
            try
            {
                while (mRunning && tcpClient.Connected)
                {
                   ...
                }
            }
        }

        private void ListenForClients()
        {
            mRunning = true;

            try
            {
                while (mRunning)
                {
                    //create a thread to handle a new communication
                    Thread clientThread = new Thread(new ParameterizedThreadStart(HeartbeatClient));
                    //.AcceptTcpClient() blocks until a client has connected to the adapter
                    // a connection attaches the new client to the new thread
                    clientThread.Start(mListener.AcceptTcpClient());          

                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Execption occurred waiting for connection: " + e.Message);
            }

            finally
            {
                mRunning = false;
                mListener.Stop();
            }
        }

The adapter isn't closing when the agent connession is missing

When the Stop method is called on an instance of the adapter there is a 20-second delay before continuing. After that the application continue running until its closing, but a library thread continue running and it doesn't allow the application to close completely, this issue does not permit the application to run again until the thread is killed by the task manager. This issue is only noticeable when the agent is missing.

Issue Terminating Console Application

Hi,

Has anyone had the following error using this library:
"Exception occurred waiting for connection: A blocking operation was interrupted by a call to WSACancelBlockingCall"

I am initializing the adapter object (MTConnect.Adapter) in the main thread and then using the SendChanged() method in a C# task. See below:

public void StartAdapter()
        {
            runLoop = true;
            adapter.Start();
            machine.Connect();
            mainTask = new Task(() =>
            {
                RunLoop();
            });
            mainTask.Start();
        }

        private void RunLoop()
        {
            while (runLoop) {
                try
                {
                    GetCurrentMachineData(machine);
                    mode.Value = machine.Mode;
                    execution.Value = machine.Status;
                    program.Value = machine.Program;
                    state.Value = machine.State;
                    spindleOverride.Value = machine.OverrideValues.speedOverride;
                    feedOverride.Value = machine.OverrideValues.feedOverride;
                    rapidOverride.Value = machine.OverrideValues.rapidOverride;
                    //errorState.Value = machine
                    //errorMessage.Value = machine.ErrorList[0].errorDescription;

                    //Update adapter stream
                    adapter.SendChanged();

                    System.Threading.Thread.Sleep(pauseTime);
                }
                catch
                {
                    Console.WriteLine("Machine is not connected");
                    System.Threading.Thread.Sleep(10 * pauseTime);
                }
            }
        }

        public void StopAdapter()
        {
            machine.Disconnect();
            adapter.Stop();
            
        }

        protected void CancelHandler(object sender, ConsoleCancelEventArgs args)
        {
            runLoop = false;
            mainTask.Wait();
            StopAdapter();
        }

CancelHandler is subscribed to Console.CancelKeyPress

I'm getting the WSACancelBlockingCall exception at
mListenThread.Join(2000);

capture

Any suggestions?

Videos are private

The "Overview" and "Hands-on tutorial" videos that are linked are coming up as "private", meaning I cannot view them. Can the be made public?

Exception while started

Hello! Sorry for stupid question, but:
When I starting WinForm project (AdapterLab.exe) i`ve got exception in MachineTools->start_click()->mWave.StartRecording();

An unhandled exception of type 'NAudio.MmException' occurred in NAudio.dll

Additional information: BadDeviceId calling waveInOpen

I seems to me I made something wrong? ...but I dont now what

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.