473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

endsend not being invoked

Hello all-

I don't know if anyone has run into this sort of a problem before, but
I'm running out of ideas, so I thought I'd post this:

I have a multithreaded server application that accepts socket
connections from clients. The server is responsible for broadcasting
string-based messages to any connected clients as it receives these
messages (from a 3rd-party source).

The socket server aspect of the application implements the
asynchronous socket model. Using performance monitor, I noticed that
the application's memory usage would begin to start creeping up as a
function of messages broadcast to connected clients. I used the .NET
memory profiler from SciTech to try and pinpoint the problem. It
turned out that there were 3 types of objects not getting cleaned up
and causing my memory leak: OverlappedAsyncResult, Overlapped, and
byte[] (the raw data of the messages being broadcast).

So, then I ran the application in debug mode and reproduced the issue.
What I was able to discover thus far is that for some period of time,
the application will invoke the delegate I specify for BeginSend, as
it should. THEN, after that period of time, it appears that the
delegate is no longer invoked on subsequent calls to the BeginSend
method. This would seem to explain the memory leak, as my
corresponding calls to EndSend would no longer be invoked where,
presumably, cleanup of OverlappedAsyncResult, Overlapped, and byte[]
take place.

Anyway, I puzzled over this for a while and then discovered that after
I terminated my clients' socket connections, THEN the delegate
invocations that seemed to be missing beforehand actually came
through! This leads me to believe that somehow, asynchronous
invocations to the delegate specified in my call to BeginSend are
somehow queuing up.

Does this issue sound at all familiar to anyone out there? If so, any
insights would be greatly appreciated!!
Nov 15 '05 #1
0 2603

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Charles Jamieson | last post by:
I declare a class class myClass{ public: ~myClass();
by: David N | last post by:
Hi All, The OnLoad() event is invoked automatically when a form is being loaded. Do we have another event that is invoked automatically after a form has completed loading? Thanks.
by: Ken Foster | last post by:
In another message thread and also in a message thread on a completely different board, there have been references to BeginSend/EndSend not sending a full message all the time. I know EndReceive...
by: RAJ | last post by:
This event appears to be invoked twice for absolutely no reason on only one of my ASP.Net web user controls. Although I've now overcome the problem by overriding the base classes OnLoad routine, I...
by: Anders W | last post by:
Hi, I'm writing a server application, using sockets (TCP) for communication. When receiving requests I'm using BeginReceive/EndReceive, and I'm handling defragmented messages. My question is:...
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In the function, I'll reading data from the record...
by: Zytan | last post by:
Everything (er, every class) in C# has ToString() which is conveniently automatically invoked when using it in Debug.WriteLine() or in a string concatenation, etc. I made a struct, and I want to...
by: johkar | last post by:
I need some browser implementation clarification. In the below example, the alternate stylesheet could be invoked by user agents that support alternate stylesheets or by script. Are there any...
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.