Jump to content

Maksim Kuznetsov

Members
  • Posts

    35
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Maksim Kuznetsov

  1. Thank you for your work Dr Powell.

    I did some testing of the following VIs from the palette:

    1.PNG.dce311abb6ec3c0f928d99f9aea43b07.PNG

    And I can confirm that I was able to establish connection using Service Name or Specific Port and
    also it was possible to isolate actor from external network by setting net address to "2130706433" (127.0.0.1).

    3.PNG.036d38be53c16f6b2938fafb97f533ab.PNG

    However I noticed that the "Name the TCP Service.vi" is now missing from the palette.
    I could still get it from the new "Create the TCP Server.vi" and wire it as a "event messenger subtype" to "Actor Startup" VI.

    Kind Regards,
    Max

  2. Hi Dr James,

    Recently I've been thinking about the security when of TCP messengers. For example,
    often I am communicating with actors from TestStand steps. Everything runs on the same PC,
    works perfectly. However, I realised that if potential attacker knows the port of the actor,
    he/she will be able to connect to my actors from outside and potentially do harm.

    At the moment I see 2 solutions:

    1. To configure Windows Firewall for the main application to only accept local connections.

    2. To bind TCP socket to localhost by specifying "net address" here:

    1474620694_netaddress.png.da8c77a00114195d927d82002e6eaf9c.png

    The second solution will work regardless of firewall settings.
    It would be great to hear your thoughts.Thank you!

    Kind Regards,
    Max

     

     

  3. Thank you James for a prompt reply.

    Indeed the "Timeout Watchdog" will make it clear to the main if something goes wrong and if the code used is well-written
    there should be no occasion when actor becomes totally unresponsive (in the ideal case).

    Thanks again for everything.
     

  4. Dr Powell,

    First of all thank you for developing a dream library (framework), I've been using it for 2 years already.
    It is incredibly powerful and elegant. There are no words to express my admiration of your work!

    For couple of days I've been thinking about one scenario:

    Imagine there are 5 actors, each of them is dedicated to one particular piece of hardware or software component. They are launched by Main actor.
    Each of 5 actors has a state and it is updated once action is performed. Now, what if one of the actors gets into an infinite loop (or an action
    that will make it stuck). In this case it won't be able to update it's state. However my Main actor doesn't know about it, it only remembers that the
    last state of that frozen actor was, for example "good".

    1. How to make the Main actor realise that one of its sub-actors is frozen?
    2. What to do in this case with a frozen actor? How to restart it?

    P.S. I've been thinking about using the "Watchdog" actor. Create 5 of them in Main actor and share with subactors.
    Then inside of subactors constantly reset the Watchdogs. If watchdog wasn't reset, Main actor gets a message.
    Not sure if this is the most elegant solution. And there is still question 2 left.

    It would be great if you could share your thoughts about this. Thank you!

    Kind regards,
    Max

    • Like 1
  5. Hello!

    In my project I created couple of tables with foreign keys. I enabled them using "PRAGMA foreign_keys = ON;".
    Foreign key constraints work when I try to add a row containing non-existent parent element, such query simply gets
    ignored without reporting an error. It makes it difficult to debug which query failed and why.

    After doing some research on why it happens, I found that foreign key constraint errors are part of "Extended Result Codes",
    (don't confuse with "Extended Error Codes"). By default "Extended Result Codes" are disabled as written here:
    Enable Or Disable Extended Result Codes

    In order to enable extended result codes the following function has to be called on the database handle:
    int sqlite3_extended_result_codes(sqlite3*, int onoff);

    Unfortunately I couldn't find an accessor method to get the database handle, so I had to modify your class and add additional
    method to it which enables the "Extended Result Codes". It is not the best solution and makes it difficult to share the code
    between machines. 

    Is there a way to enable extended result codes without modifying the SQLite library source?

    SQLite is a great library, thank you James for it!

    Max

    • Like 1
  6. Thank you very much for a prompt reply James!

    Your solution makes sense and it works nicely for errors that occur in the sub-actor when there were no
    messages sent to it (error triggered inside by some other events). However, imagine the main actor is registered
    for all errors with a translator and I send a synchronous request to it:

    Potential error.png

    The request potentially could result in an error which will go directly to the error handler, but since
    the main actor is also registered for all errors it will get another message with the same error.
    Basically, the error gets reported twice.

    Similar thing happens when there is an asynchronous reply coming into the main actor containing an
    error:
    Potential error_async.png

    In this case I receive an error by a separate message (registered for it) and also as a reply
    to my asynchronous request.

    Both messages will have different labels, one is 'Inst 1 -> Error' another will be 'Inst 1 --> Reading'.

    I spent couple of days thinking of the way of handling errors in one place, because my system is designed
    to act autonomously on some particular errors, on other to ask user what to do. I still can't think of the
    elegant way of doing this.

    It would be great if you could share your thoughts with me.

    Thanks again!

    Kind Regards,
    Max

  7. Dear James,

    Recently I started to use your elegant messaging library, it is something I always wanted to have and even
    invented my own wheel before I found what you have done.

    Imagine I have 3 actors:

    1. Launcher
    2. Two instances of the instrument actor.

    To make the code easy to read I use the message translator for each instrument. However when error
    occurs in one of the instruments it goes directly to the 'Launcher' actor to its 'Error Handler'.

    My questions are:

    1.How do I know which instance of the Instrument actor triggered an error?
    2.How do you handle errors in your multi-actor systems?

    Thank you!

    Kind Regards,
    Max

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.