Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What is happening

Posted on 1997-08-01
2
Medium Priority
?
540 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses

618 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