Wait for a LAN connection
Wait for a LAN connection
How is possible to wait for an activation of a net connection at a secific address?
I would like a function like the Command line
Netstat
but asynchronous, tha automatically active when a specific address and port begin active (I need to detect when a LAN remote control begin active, without a cyclic Netstat).
Thank you very much.
I would like a function like the Command line
Netstat
but asynchronous, tha automatically active when a specific address and port begin active (I need to detect when a LAN remote control begin active, without a cyclic Netstat).
Thank you very much.
Re: Wait for a LAN connection
If you want to detect an RDC connection there is information here:
https://superuser.com/questions/1200200/how-to-properly-quit-from-a-remote-desktop-session-tsdiscon-now-logs-the-local
You can have a Timer to check for RDC frecuently:
https://superuser.com/questions/1200200/how-to-properly-quit-from-a-remote-desktop-session-tsdiscon-now-logs-the-local
You can have a Timer to check for RDC frecuently:
Code: Select all
Thread("Interrupt", 0) ; Make all threads always-interruptible.
SetTimer("Check_RDC", 10000) ; every 10 segundos, look for RDC
Return
Check_RDC:
RDC := SysGet(4096) ; returns returns 0 when there is no RDC Connection
; returns NonZero (tipically 1) when RDC is active
If RDC
{
; here you do whats needed
}
Return
SysGet(SubCommand) { ; from https://www.autohotkey.com/boards/viewtopic.php?f=37&t=29689
Local OutputVar
SysGet, OutputVar, %SubCommand%
Return, OutputVar
}
Re: Wait for a LAN connection
I know the timer function.
I would like an asychronous function to activate ONLY when a specific connection at a specific address and port begins (like a Dll Api function).
I need to to detect if the number of the RDC is modified or if one or much RDC are changed.
Re: Wait for a LAN connection
Do you know if is possible to wait for an activation of a net connection at a specific address?
I would like a function like the Command line
Netstat
but asynchronous, tha automatically active when a specific address and port begin active (I need to detect when a LAN remote control begin active, without a cyclic Netstat).
I need to detect if and when one or more Remode Device Controller (or Remote Access) are active.
Thank you very much.
I would like a function like the Command line
Netstat
but asynchronous, tha automatically active when a specific address and port begin active (I need to detect when a LAN remote control begin active, without a cyclic Netstat).
I need to detect if and when one or more Remode Device Controller (or Remote Access) are active.
Thank you very much.
Re: Wait for a LAN connection
Thank you very much.
I no know C++, then I am no very able to understand all on the link.
Is there a simple way to detect any specific LAN open (or close) connection?
I no know C++, then I am no very able to understand all on the link.
Is there a simple way to detect any specific LAN open (or close) connection?
Re: Wait for a LAN connection
Do not think that there is simple way.
Re: Wait for a LAN connection
Ok.
Do you know if there is an API way to wait for a specific lan connection?
Do you know if there is an API way to wait for a specific lan connection?
Re: Wait for a LAN connection
On my link it is api. It is not c++ code.
You can search forum for functions that are used on my link and try to build some code.
Also wmi has some event notification, but it works like You set timer within wmi and wmi with this timer checks if event occurs. (IMHO not best decision)
https://learn.microsoft.com/en-us/windows/win32/wmisdk/swbemsink
You can search forum for functions that are used on my link and try to build some code.
Also wmi has some event notification, but it works like You set timer within wmi and wmi with this timer checks if event occurs. (IMHO not best decision)
https://learn.microsoft.com/en-us/windows/win32/wmisdk/swbemsink
Re: Wait for a LAN connection
If you go for swbemsink you can take a look at these examples:
viewtopic.php?f=83&t=105171
Or this (but would have to be adapted to your needs):
viewtopic.php?f=83&t=104451
viewtopic.php?f=83&t=105171
Or this (but would have to be adapted to your needs):
viewtopic.php?f=83&t=104451
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Wait for a LAN connection
Now I understood topic starter question and think that it can be done with this api
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsregistersessionnotification
https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsregistersessionnotification