Answer the question
In order to leave comments, you need to log in
Problems with continuous reading of a file from a network folder?
Hello. I don't even know where to put this question. We have a program in our organization that uses files exclusively as a repository of information. It has a server part that maintains a database every second (actually writes information to files) and client applications that read these files. They get access to them through network folders, that is, the user connects a network drive, the program opens the database files on this drive for reading at startup, and during operation it simply reads new lines from the files (the files open once when the program starts and, accordingly, are closed when its closure) We will miss how good or bad this architecture is.
The essence of the problem is that in our organization computers began to appear where this system fails. Let me explain. The network drive is available and through the explorer all files are available and open. When the program starts, it opens files without any problems and receives information, but then something strange happens, it does not see that the file is being appended, and accordingly does not update the information.
The program is written in Delphi and uses the system functions of Windows API ReadFile from Kernel32.dll.
A bit of information on problematic computers:
1) We have more than 5 thousand PCs scattered throughout the country in our organization, and errors occur, well, maybe by 3-5%.
2) The computers themselves have nothing in common, they are different hardware, different OS builds.
3) We have a batch of 50 monoblocks in one wing for 49 everything works, but not for 50, although one is the same, and even the OS on them is oem (logically it should be the same).
We tried to communicate with the developers, they claim that the problem is not in the software, but in the system, but we have already broken our heads trying to understand where in the system such strange behavior is formed.
Answer the question
In order to leave comments, you need to log in
How good or bad this architecture is will be missed.
I also tried to work with a subscription to these functions, it works through w. The problem is in the server, which, as I understand it, "does not send a notification to clients" and, accordingly, they do not see that the update has occurred. Sometimes reinstalling the axis on the server helps, but temporarily, then it still stops working.
I won’t repeat about the software, since everything is accurately and correctly written, but in any case the problem needs to be solved, and here I can advise you to make a terminal server with a connection to this ball, and distribute rdp shortcuts to clients. You can completely remote, you can through RemoteApp.
In this configuration, there will be only one network failure point.
This problem seems to be in network communication. Packets are lost on the network along the way and the connection hangs until you distort it - on the server, the connection falls off by timeout, and the client is not aware of these events.
As a temporary solution - reopen the file if there were no updates last minute.
But apparently, the problem can be solved more simply by writing your own server for this case, which will simply send out changes to the file to all connected clients. Apparently, the changes to the code need to be minimal - instead of the file open function, substitute the socket open function, and replace the reading with reading from the socket.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question