?
Solved

What is happening

Posted on 1997-08-01
2
Medium Priority
?
549 Views
Last Modified: 2008-02-26
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.
0
Comment
Question by:rjorgy
2 Comments
 
LVL 11

Expert Comment

by:mikeblas
ID: 1166606
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
0
 
LVL 3

Accepted Solution

by:
EricKaplan earned 400 total points
ID: 1166607
I would suggest using a block-send-recieve verification mechanism as the server and client needs to be synchronized to the slower one, otherwise timeouts may occur.

Theoretically, writing to a socket is like writing to a file. There is no diffrence in the interface, but rather in the implementation. If the client is to slow or vise versa and there is no synchronization ... ;-)

-Eric.
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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

831 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