Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Application run over network causing problems....

Posted on 2001-06-22
20
Medium Priority
?
150 Views
Last Modified: 2010-04-06
Hi.

I have a client/server setup going on with a few applications.  The first application, the client, sends a message to the server application which does loads of stuff on another PC (not really relevant what it does), and then creates an output file.  Then, the viewer program is run on the client machine so that they can see the output.

The problem I have is that the "resources" are apparently still connected to the "client" machine.  (I should have mentioned that the client side software is all stored in a public directory on a seperate networked PC.)

For example, if I try to delete the viewer application, it won't let me, as if the program is still running.  But, if I view the "open resources" in the "control panel/server" applet, it shows the physical connections are still there.

I don't want every user to remain connected after they have used the software.

This is quite a serious issue and I need some help getting round it.  I'm not sure if the Delphi area is the best place to ask, but I'd prefer to solve the problem programatically, from within the software.

Thanks for any help,

John.
0
Comment
Question by:Jaymol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 7
  • 2
  • +1
20 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6217930
Maybe you can make a local copy of the viewer application before running...
0
 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6218004
This sounds like a server problem. You say that the viewer application is closed, but the .exe file remains open, right?
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218034
It's the physical connection to the machine which holds the client & viewing software that's the problem.

This remains, even though the app(s) are closed.

John.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6218036
btw, I red somewhere in the MSDN (oh, somewhere in the MSDN!) that Microsoft recomends Excel to be started localy, because there is a problem if it is started from a server. The program itself looses the connection with the .exe file in the remote machine or something like that. Haveing local copy of the viewer is realy a good idea.
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218039
Btw, I have checked the process list (NT4) and the apps are definately closed.

John.
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218042
I'll try copying it locally 1st.

Ta.
0
 
LVL 17

Expert Comment

by:geobul
ID: 6218056
Hi,
I'm afraid that it is a global NT problem. After some time of inactivity (undefined period - I have seen it for days), the NT will refresh its resources usage and will free them and disconnect the users. Moving the program to the client PC will not help you (the resources on the server will remain in use). The only way to do this from the remote PC, I've reached, is to disconnect the shared drive and connect it again.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218061
Thanks Geo, but if there's a button in the server applet that allows you to disconnect users, then there must be a way to do it programatically, therefore allowing me to disconnect a user, via the server application, once it knows the user is done.

Thanks,

John.
0
 
LVL 17

Expert Comment

by:geobul
ID: 6218062
If you copy the program and the files it uses locally, it will solve the problem. Do not open them remotely using a local program.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218069
The files have to be available remotely as there are so many/they're so big.

John.
0
 
LVL 17

Expert Comment

by:geobul
ID: 6218127
How could you know that the user has finished while the connection is still active? Such a program should be running on the server (as a service for example) and to disconnect users after a predefined idle period has been reached. But I have no code for doing this.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218131
The server application runs a process and then tells the client that it's done.  Therefore, the server knows it can close the connection before the client.

All I need now is to know how to close the connection.

John.
0
 
LVL 17

Expert Comment

by:geobul
ID: 6218208
Take a look at NetSessionEnum and NetSessionDel API functions.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6218229
I will.

Ta,

John.
0
 
LVL 17

Accepted Solution

by:
geobul earned 1200 total points
ID: 6218372
Hi John,

procedure TForm1.Button1Click(Sender: TObject);
var TheDll : dword;
    NetSessionDel : function (server, client, user: pWideChar) : dword; stdcall;
    res : dword;
    sWide : PWideChar;
    sWideLen : integer;
begin
  TheDll := LoadLibrary('netapi32.dll');
  NetSessionDel := GetProcAddress(TheDll, 'NetSessionDel');
  sWide := StringToWideChar(Edit1.Text,sWide,sWideLen);
  res := NetSessionDel(nil,nil,sWide);
  FreeLibrary(TheDll);
end;

// tested on NT4 server. Receives the user name from an edit box and closes his all connections.

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 6231966
Hi John,

Have you tested my last code? I forgot to say that the user name should not include the domain name and a slash.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6234181
Sorry Geo, I haven't had chance yet.

I'll give it a go today and get back to you.

John.
0
 
LVL 17

Expert Comment

by:geobul
ID: 6234277
Don't bother yourself. I have nowhere to hurry on. I was afraid that you hadn't seen it.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6234283
Ok.  Ta.

John.
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6276146
Thanks for your help.

John.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question