Link to home
Start Free TrialLog in
Avatar of rjorgy
rjorgy

asked on

What is happening

We are developing a client/server application that currently runs on Windows NT 3.51. The server is written in Visual C++ 4.2 using MFC (all patches installed). The client is written in Visual Basic 4.0, and also uses an OCX written in Visual C++ 4.2. There are a number of Access 7.0 database files.

Client<->Server communication is via Windows Sockets with objects derived from the MFC CSocket class, and CObject derived objects are serialized over the socket connections. The client OCX file handles the sockets communication with the server and passes data between itself and the VB part of the client application using OLE controls. The server, ‘main’ client, and the applications database files exist on one computer. We usually run approximately 4-5 ‘remote’ clients on other computers.

At certain points while the application is running large amounts of data can be broadcast from the server app to the clients. This causes a noticeable slow-down of the server and clients. Our problem is intermittent CFileExceptions occurring in the CSocket objects. Specifically, the two exceptions that occur are:

1.  An attempt was made to access an unnamed file past its end.
2.  An unknown error occurred while accessing an unnamed file.

The object types that are being passed over the connection when these exceptions occur do not seem to be related to the problem, because they are common message objects that are always being passed around. In addition, we have verified the integrity of all message objects in the system.

We do not know specifically why these exceptions are occurring and why the built in CSocketFile and CArchive mechanisms are not preventing them, but the problem seems to be aggravated by high network and application activity. At this point we are catching the exceptions, and then closing the socket connection. What we would like to do is eliminate the occurrence of these exceptions, or at least be able to recover from them without shutting down the socket connection.
Avatar of mikeblas
mikeblas

MFC classes, like CSocketFile and CArchive, don't prevent exceptions. If you abuse the classes, you'll get exceptions because you're causing an error.

You need to debug your code.

.B ekiM
ASKER CERTIFIED SOLUTION
Avatar of EricKaplan
EricKaplan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial