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 2 1304
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.Applicati on.AddMessageFi lter
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.Manageme nt namespace.
Thats about all the advice I can offer.
-CJ
"Nico" <bo*******@hotm ail.com> wrote in message
news:%2******** ********@tk2msf tngp13.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
You set up the Main listener as a base class that listens for the connection, this on the acceptConnectio n 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 advance :(
data = "it is an <atag> example of the kind of </atag> data it must
handle and another kind of data".split(" ")
|
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 applications with it,
but I'm very bad in architecture design. Can somebody help me to define
it ?
Each material can be affected to a center, a user or to the company
(like servers). This application have to allow some actions to users,
|
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 Windows and Unix and I need work because I am graduating in a few months.
Instead of just reading books to refresh my memory, I'm going to build a large (4 month)
project that encompasses all the C++ material. I think this is a better way of...
|
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 are welcome.
So there it is, i'm developping an asp application that will be
accessed by many workers in a company. The app is basically dealing
with parts and customers (we sell pieces off all kind and we have lot's
of customers). My database...
|
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, the number and the date of each
reservation, and where he can check a checkbox beside each reservations to
cancel it (or them).
Those data are in a database. I use aspnet 2.0.
What i would like is a table with four cells (one for each field + one...
| |
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 gracefully
exit the app.
2. capture vital error info for developers (such which application,
where in the application, what type of error such as network, database
connection, VB and so on, and error details) into a sql database for
diagnosis.
...
|
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 to read from and write to files:
#include <fstream>
#include <sstream>
#include <string>
|
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 function multiple times to write out the advices to different folder, based on the color sent to the function. However, the program only writes the advices out to one folder. Can you help based on the code that I am attaching to the email?
|
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')
home
page1.php - require_once('../inc/layout.php')
page2.php - require_once('../inc/layout.php')
|
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. I am still new in design and
analysis, so any extra informations are greatly appreciated. Right
now, it is the initial phase, planning. So I need to decide which to
adapt. I had been read some of the open source projects code, and
majority seems...
|
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...
| |
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...
|
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...
|
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,...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
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
| |