473,573 Members | 2,829 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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: OverlappedAsync Result, 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 OverlappedAsync Result, 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 2615

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 doesn't always receive a full message, and have coded for EndOFMessage markers etc. But Microsofts documentation implies that if I say...
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 could never figure out why this event was being invoked twice. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)...
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: Do I have to handle defragmented messages in the server when sending the reply to the client (or can the EndSend return-value be smaller than the...
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 the cursor was on in the datasheet at the time I executed the macro. So, the questions are: 1) In the macro, how to I get my hands on 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 make a method to print out its data in a similar format. So, I did this: public struct MyStruct { public override string ToString() {
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 browsers that don't recognize "alternate stylesheet" as a value of the rel attribute and just implement it automatically thus overriding sheet2.css? ...
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 do this. Many thanks for your time. Nick.
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.