Solved

What is happening

Posted on 1997-08-01
2
501 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 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