473,404 Members | 2,178 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,404 software developers and data experts.

I need some advices please

Hello everyone,

I have re-formulated the question I asked on my last post::

I am trying to capture the System event raised when a Network Connection
is established in VB.NET (ie. connection from a client to a network
resource, just like the winsock control did successfully for so many years)
AND the one that is raised when data is recieved on this connection. I have
seen many posts suggesting to create a timer and check the network status
(or even use endless loop instead of a timer) but I find this much too
resource hungry for my requirements.

I want to catch the event when it arrises, just like Winsock did or the
event listeners in Java. I know there is a way to do this, I believe it
exists, Microsoft are not the kind of enterprise to start from something
that works well (ie: winsock) and go backward to the flinstone's era (ie:
using an endless loop or a timer to pool again and again and again and eat
all your precious CPU time... The interrupt controler on the PC isn't there
just for the good looking, it have it's purpose and one of them is to "Tell"
that something happened on that or that part pf the hardware, etc.). This
was once implemented and I don't see why this would have disapeared just
like this.

Perhaps I can listen to Windows messages or something like that (if I knew
what to listen for!).

I have tried search MSDN, Google and this newsgroup for a working solution
(Without the loops / timers) but have not been successful.

Any help/code would be greatly appreciated.

Thanks

Nico
Nov 20 '05 #1
2 1291
You can monitor windows messages, but it sounds like your looking for a
global hook scenario...

Now, I'm still learning how windows message pumps work so I may be wrong in
this but I'll attempt it nonethless..

You could try using the System.Windows.Forms.Application.AddMessageFilter
method to intercept windows messages, but I don't know if that will
intercept all of them.. or if its possible. But that way you could monitor
IF you could find which message you were looking for...

http://www.mangovision.com/vbapi/ref/msgc.html

here is a list of windows messages, but I don't know if it will provide you
what you want.

The second way is to start a separate thread and poll WMI every 5 seconds or
so using the System.Management namespace.

Thats about all the advice I can offer.

-CJ
"Nico" <bo*******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello everyone,

I have re-formulated the question I asked on my last post::

I am trying to capture the System event raised when a Network Connection is established in VB.NET (ie. connection from a client to a network
resource, just like the winsock control did successfully for so many years) AND the one that is raised when data is recieved on this connection. I have seen many posts suggesting to create a timer and check the network status
(or even use endless loop instead of a timer) but I find this much too
resource hungry for my requirements.

I want to catch the event when it arrises, just like Winsock did or the event listeners in Java. I know there is a way to do this, I believe it
exists, Microsoft are not the kind of enterprise to start from something
that works well (ie: winsock) and go backward to the flinstone's era (ie:
using an endless loop or a timer to pool again and again and again and eat
all your precious CPU time... The interrupt controler on the PC isn't there just for the good looking, it have it's purpose and one of them is to "Tell" that something happened on that or that part pf the hardware, etc.). This
was once implemented and I don't see why this would have disapeared just
like this.

Perhaps I can listen to Windows messages or something like that (if I knew
what to listen for!).

I have tried search MSDN, Google and this newsgroup for a working solution
(Without the loops / timers) but have not been successful.

Any help/code would be greatly appreciated.

Thanks

Nico

Nov 20 '05 #2
You set up the Main listener as a base class that listens for the connection, this on the acceptConnection spawn another class that accepts data and processes it. Once the spawned class is finised with the processing you can disconnect it. This would mean that the server class would only be lisening and the pass the rest of the processing power to the client class that you spawned

I have been working on something like this for an online Game engine, but with me I would be sending data to the client all the time and recieveing a pulse to make sure that the connection is still open, if no connection is there I release the connection and thread

Glenn
Nov 20 '05 #3

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

Similar topics

2
by: Joh | last post by:
Hello, (sorry long) i think i have missed something in the code below, i would like to design some kind of detector with python, but i feel totally in a no way now and need some advices to...
0
by: Gildas Garcia | last post by:
Hello ! I need to build a intranet website which will manage all materials (computers, cars, printers, ...) for all centers of my company. Actually, I know c# and have already built some...
5
by: Kevin Carne | last post by:
First, Merry Christmas. I have been doing intensive Java programming for two years in school (no choice on the language), but now I need to return to C++ because my resume is filled with it both in...
3
by: mateo | last post by:
Hello i would like to have advices on an ASP.NET 2 application that i must develop. I'm new to ASP.NET, i am more of WinApp developper, so if there is some experienced folks out there all advices...
1
by: Ben | last post by:
Hi, I come from classic asp and i need some advice for this application. It's about a computer reservation system in a school. I want a page where a student can see his own made reservations,...
2
by: ===Steve L.=== | last post by:
does anyone know any site or ariticle provides exmaple for building a Global Error Handling Module in VB.Net? the module should be able to 1. prouduce friendly generic error msg for the users and...
15
by: Gan Quan | last post by:
I'm writing a c++ program that has many (100+) threads read/write files simultaneously. It works well if not considering the efficiency. The file i/o seems to be the bottleneck. This is my code...
1
by: murdla | last post by:
Hello. I am working on a project where users can automatically create personnel advices on the mainframe through a .NET Web Service. My current problem is that I am trying to call a...
2
by: Francesco | last post by:
Hi there! I'm trying to organize my sources into a webroot tree like this, webroot index.htm - only contains index.php into a frame index.php - require_once('inc/layout.php') ...
14
by: Leah | last post by:
I am a student and are required to build a website that provide services (client-server). I need advice in choosing approach or to be exact the methodology that appropriate for such development....
0
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
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
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...
0
agi2029
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,...
0
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...

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.