473,811 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URGENT help on io completion port

Hi
I have this simple test console app. Main function creates a thread which is calls GetQueuedComple tion port. After creating a thread it keeps on calling PostQueuedCompl etion port in an infinite loop .

On running this test program, i see the memory usage in task manager continously rising??
I am pasting the code below. Can you see anything wrong?

//my ov struc
class OVERLAPPEDPLUS :public OVERLAPPE

public:
CComVariant xmlMessage
vector<CComBSTR > m_vecobjectId
CComBSTR msgId,queueId
//my worker thread class's main routin
int CPublisher::Run (

HRESULT hr=S_OK
DWORD dwThreadID,nByt es
ULONG_PTR CompKey

bool bexit=false
tr

dwThreadID = GetCurrentThrea dId()
while(1

nBytes=0
OVERLAPPEDPLUS *polplus=NULL
m_iocp.GetStatu s(&CompKey,&nBy tes,(OVERLAPPED **)&polplus)
switch(CompKey
{

case OP_PUBLISH
g_ltraceSteps = -9
//initially i though this function caused the leak. a lot of xpath queries.comment ed it out to narrow the leak searc
// PublishMessage( polplus);
g_ltraceSteps = 99
delete polplus

break

if(bexit
break
catch(...

hr=E_FAIL

return hr
int main(int argc, char* argv[]

printf("Hello World!\n")

CoInitializeEx( NULL,COINIT_MUL TITHREADED)
CComVariant var
VARIANT_BOOL vb
CComPtr<XTXMLNS ::IXMLDOMDocume nt2> m_pDoc
HRESULT hr = m_pDoc.CoCreate Instance (__uuidof(XTXML NS::XT_DOMDocum ent))

var = L"C:\\xtelligen t\\transactionm sg2.xml"

m_pDoc->load(var, &vb)

CComVariant inXml

IUnknownPtr pUnk
if(m_pDoc != NULL
m_pDoc->QueryInterface (__uuidof(IUnkn own), (void**)&pUnk)
_variant_t retVal(pUnk.Get InterfacePtr())
inXml = retVal
retVal.Clear()

auto_ptr<CIOCom pletionPort> m_iocp = auto_ptr<CIOCom pletionPort>(ne w CIOCompletionPo rt(1) )

WorkerThreadPtr workerThread = auto_ptr<CPubli sher>(new CPublisher( *m_iocp.get() ) )

workerThread->Start()
int u=0

while(1

OVERLAPPEDPLUS *olplus = new OVERLAPPEDPLUS
olplus->xmlMessage = inXml
olplus->msgId = L"1"
olplus->queueId=L"2"
VariantCopy(&ol plus->xmlMessage,&in Xml)
olplus->bpush = false
olplus->bsave = false
olplus->bCleartransact ionid = false
olplus->bskipmetadatap rocessing = false
m_iocp->PostStatus(OP_ PUBLISH,0,olplu s)
return 0

}
Nov 17 '05 #1
0 1364

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

Similar topics

3
10600
by: Josh | last post by:
A while back I started a project to write a mail server. I was doing this in c++ and found that I/O completion ports were the best solution for the project. I've since decided to port my application to the .NET framework and noticed that the concept of an I/O completion port doesn't exist natively in the framework. It does have similar counterparts with BeginRead, BeginSend, etc. I see I have two options, I can write some unsafe code...
0
1490
by: Henrik Nordgren | last post by:
Im trying to build a simple chat app... here is the code: server visual basic code:-------------------------------------------------------------------------------- Public Class ChatServer Public Sub New()
0
1185
by: Phadnis | last post by:
hi i want to build a vb.net applicaiton that would access the port 80 to get the content of the web page before it is displayed to the browser. since all the http request will go through the port 80 i want to read FROM PORT 80.. plz this is urgent. Thks
0
286
by: Nadav | last post by:
Hi, Usage of FileStream ( and other stream related objects ) internally use an IO Completion port, Now, Taking that in mind, does all of the stream object of a certain process use a single IO Completion port common to all streams ( file based streams, e.g. socket, file, ... )? This could easily done with Win32 API by creating a single IO Completion port and associating it with several file based objects ( e.g. several sockets ). Usage of a...
0
931
by: vengefulemus | last post by:
I'm looking for a simple c/c++ code example that uses overlapped IO, and specifically completion routines to do simultaneous ReadFileEx and WriteFileEx from a simple serial port. I can't, for whatever reason, seem to get it to work. I can find code snippets on the net, but nothing that seems to get me where I need to go. Seems to be an amazingly simple problem, but amazingly seems to elude me. Help
1
1699
by: Nadav | last post by:
Hi, Introduction: ************************* I am developing communication infrastructure for a streaming video server, to achieve optimal performance I use IO Completion ports & a thread pool in combination with winsock MsAPI ( e.g. ConnectEx, AcceptEx, … ), sending data through sockets is done with Read/WriteFile. The problem:
4
13199
by: VB Programmer | last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When I precomile it to my web deployment project and then copy the debug files to my web server I get this problem when trying to login (obviously it's using ASPNETDB.mdf). Any ideas? Server Error in '/' Application. --------------------------------------------------------------------------------
5
24027
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2 development client. Bur Its gives me following error message. I searched lots of things on net and tried on remote server but i didnt got suceess. Can any one tell me how to set TCP\IP
1
7846
by: abolduc | last post by:
I have had an underwhelming amount of success hunting down the source of this error and am hoping that someone here may have some insight. Error logged in the event log: Source: MSSQLSERVER Category: (2) EVENT ID: 17887 Description: IO Completion Listener (0x754) Worker 0x00FEC0E8 appears to be non-yielding on Node 1. Approx CPU Used: kernel 0 ms, user 0 ms, Interval: 15187.
0
9728
marktang
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4339
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
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.