Solved

What is happening

Posted on 1997-08-01
2
487 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 200 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now