-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update IOSDeviceManager.ts #1392
Conversation
Improvements Made: Port Usage Control: Functions getFreePortWithCheck and getUnusedPort were added to more accurately check whether ports are available. This is an important step to prevent port conflicts. Safe Port Selection: By using getUnusedPort, safe port selection is ensured for wdaLocalPort and mjpegServerPort. Error Handling and Logging: Parts related to checking port availability and logging errors have been improved. With this code, the risk of port conflicts has been reduced, and port management is now handled in a more reliable way. #1340
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
review comment edit
@erdncyz This will still not help solve the issue. When the server starts we pick all the devices and get a freeport and assign to the device object. At the time of assigning the port is available, issue comes up with the session creation happens. At this time the port is already picked by some other process. Fix: During session creation for iOS you need to check if the port is free, if not get another free port and re-assign to the device object. |
Hi @saikrishna321 @SrinivasanTarget @sudharsan-selvaraj , ı change my code for your comment @saikrishna321 can you check again please.
|
During port selection, even if a port appears to be available, it may later be used by another process. In particular, race conditions can occur when ports such as wdaLocalPort or mjpegServerPort are being used simultaneously by another process.
Improvements Made:
Port Usage Control: Functions getFreePortWithCheck and getUnusedPort were added to more accurately check whether ports are available. This is an important step to prevent port conflicts. Safe Port Selection: By using getUnusedPort, safe port selection is ensured for wdaLocalPort and mjpegServerPort. Error Handling and Logging: Parts related to checking port availability and logging errors have been improved. With this code, the risk of port conflicts has been reduced, and port management is now handled in a more reliable way.
#1340