Hi,
I made a development which uses Navision Socket Bus Adaptor. On the server (native) there is a CU that searches for idle users on fixed intervals and if finds, it sends messages to one computer name. It's something like:
OutMsg := ComCom.CreateoutMessage('Sockets://Computer1:8079');
OutS := OutMsg.GetStream();
OutS.WRITE(User ID);
On the clients I have a single instance CU that receives the message and closes that client.
The problem is that I don't know the computer name/IP address of the idle user from Nav server :-k . Is there any way to find the computer name asociated with one session in Nav? The command ENVIRON('clientname') works only if the client is connected through remote. Or, is there any way to send messages through sockets to the entire network? This way, transmitting the userid from the server, only the client with that ID will close.
Thanks in advance and have a nice day!
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://www.mibuso.com/forum/viewtopic.php?t=14707, I found a solution. When every client opens a company I send the computer name into a temporary table and then I use this information for automatically close idle clients.
Thanks garak.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
So, what I want to do: On the server side (Navision Database Server), I have a CU that periodically searches for idle clients in Session table. If it finds idle clients, I want to send messages to all the network with the idle client user ID. On the clients I have single instance CU that verifies if the user ID sent is the current USERID, then closes that client (I send a dos command, "taskkill /IM fin.exe" to close the Nav client).
I tried all the communication methods from Navision SDK and closely followed the exemples from devguide.chm:
1) Navision Socket Bus Adaptor - it works well only if you know the computer name associated with a session, but I don't have this info at server side (Navision Database Server has incorrect info about host name in Session table). The command is: If I send message to a closed computer or one that doesn't exist, the socket bus adaptor returns an error message. I guess through sockets you cannot send messages to all the network in Nav...
2) Navision Named Pipe Bus Adaptor - works well only if using two clients on the same PC (one sends the message and the other receives it). But on the network it doesn't work. If I have clients computers with single instance CU and send a message from a client on the server, that client crashes:
3) Navision MSMQ Bus Adaptor (apparently the best communication interface) - I created a private queue (works with public queue also) on the server then send a message from the server. The problem is that only the first client with single instace CU that receives the message processes it, then the message is destroyed. Is there any way to keep the message alive after reaching the first client through the network so that it reaches to all the clients? #-o
I hope I didn't bored you with my post but I'm stuck with these communication components...
"your session has timed out" or something like that?
Note; I also remember a post about only allowing 1 login per user but I can't find it rightr now.
I believe it used CU1 to check if the username was already logged in and wouldn't allow it to login again. Perhaps someone can find it.
We use www.autocloseidle.com (not as sophisticated as Expandit's solution)
also
Expandit Client Manager is available
http://www.expandit.com/templates/expan ... log_id=635
Supports Navision versions 1.10 to 4.0 SP1 List user name of active Navision users sessions. Identify computers that run Navision user sessions. List running user sessions. Shows process information for user sessions. Send messages to Navision users. Shut down individual or groups of user sessions. Terminate user sessions running on remote machines. Central management of ExpandIT Client Control configurations. 99 user group option sets. Limit number of sessions per user for one user or groups of users. Allows multiple installations of ExpandIT Client Manager. Control period of inactivity before log off. Set time for automatic shutdown of Navision user sessions. Show time left before users sessions are automatically terminated. Easy to install and maintain.
=P~ =P~ =P~ =P~
http://www.BiloBeauty.com
http://www.autismspeaks.org
WshShell Automation 'Windows Script Host Object Model'.WshShell
Command Text 250
WindowStyle Variant
WaitOnReturn Variant
ReturnCode Integer
Str Text 100
That is why I want to send messages with the idle client ID.