Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am building a small application in c#.
My application needs to get notified as soon as other applications open a port.
with some pinvoke calls I can get only the ports which are open when the call was made.
Only solution i found is to use a timer and compare the results obtained in each pinvoke call.
but this is not an elegant solution. can someone point me to a better solution.
Posted
Comments
Florian Trück 8-Feb-14 7:53am    
Maybe you can find a windows message which notifies about an opened port.

protected override void WndProc(ref Message m) {
Debug.WriteLine(m);
base.WndProc(ref m);
}

1 solution

There is no such event or callback.

Your only solution is to poll for the open ports as you already are.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900