I have a server developed with UnifiedAutomation SDK (version 3.4.1) that works on 41969 port.
I connect UaExpert (version 1.7.1) to it and everythings works well.
When I close the server sometimes UaExpert keep 41969 port busy, as shown in PerformanceMonitor:
This makes problems if I start server again. Server cannot connect to port.
I tried to close connection manually before quit server, but it doesn't works:
the root cause of this is hard to estimate with this little information.
If you "gracefully" close the server (real shutdown), the server will close all connections and shut down, including closing the socket and TCP connection of all endpoints being used. However when you "kill" the server, or when the server could not close the socket (because it is blocked or hang, or being busy), you must wait until the operating system timeout finaly releases the resource. Such timeout might be different on different Windows and on Linux systems, and is outside the control of the UA server (it is an operating system feature).
As long as the port is "in use" by the previous application instance, you can not restart. On Windows with .NET SDK one application is exclusively using the port (you need to check if previous server instance is really gone).
With "netstat -a" on the command promt you can list the used ports (in listen mode) and see which application is using them and how long. In any case the graceful shutdown is typically the fastest way to "free" the port and get it again after restarting the application instance.