Jump to content
drjdpowell

[LVTN] Messenger Library

Recommended Posts

Your right, there is a reference leak here.  That Queue is a reference created in the actor's calling code, and is used to trigger the "Autoshutdown" message when the caller stops, thus invalidating the Queue.  There is an async component called the "ReferenceMonitor" which watches that Queue and sends the Autoshutdown message then closes.   ReferenceMonitor also polls the actor's address, so it can shut itself down if the actor dies.  However, I forgot to destroy the Queue in that case.   Here is an image where I have added the needed Close operation:

2146204797_FixReferenceLeak.png.3fb51efbe10eae86af6c78643cb176a8.png

 

Thank for spotting this,

-- James

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites

What number do I feed to "net address" to make it local host only?  I wasn't aware of such a feature.

Share this post


Link to post
Share on other sites
26 minutes ago, drjdpowell said:

What number do I feed to "net address" to make it local host only?  I wasn't aware of such a feature.

I would imagine the string 127.0.0.1 (or u32 Net Address 2130706433)

image.png.6464f93267112eda4e7c4c15170c010b.png

Share this post


Link to post
Share on other sites

Thank you for your input on this! Indeed bbean is right, it could be 127.0.0.1 or "localhost" converted to u32 net address.
As a potential idea the "net address" could be a parameter when configuring the TCP Messenger.

Thank you both!

Kind Regards,
Maksim

Share this post


Link to post
Share on other sites

Here is a beta version, 1.11.0, with changes to TCP Messengers to support the various TCP options about ports and the like.  Also adds a Keep-alive to detect half-open connections.  Bitbucket Issues 26, 27, 33.  I have not had time to do more than a basic test; it would be a help if someone could give it a try.   Note that I've replaced some of the creation VIs for TCP Messengers in the pallette (originals should still work, but I wanted to change VI names).

drjdpowell_lib_messenging-1_11.0_116.vip

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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