Random Connection Reset

(From kuljanow) We are trying to use the VirtualHere USB Client+Server (trial) in automated mobile testing trial runs with Appium. The tests are running on a VM that is accessing a Nexus 5X smartphone via VH. Now, at random times during the test execution, the TCP connection to the phone is reset, forcing Appium and the adb server to crash after the following node exception:
uncaughtException: read ECONNRESET
{"date":"Tue Jan 16 2018 11:12:01 GMT+0100 (W. Europe Standard Time)","process":{"pid":27232,"uid":null,"gid":null,"cwd":"C:\\Users\\DailyBuild","execPath":"C:\\Program Files (x86)\\nodejs\\node.exe","version":"v8.9.3","argv":["C:\\Program Files (x86)\\nodejs\\node.exe","C:\\Users\\DailyBuild\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js"],"memoryUsage":{"rss":113274880,"heapTotal":91222016,"heapUsed":81269552,"external":457082}},"os":{"loadavg":[0,0,0],"uptime":512433.3543791},"trace":[{"column":11,"file":"util.js","function":"_errnoException","line":1024,"method":null,"native":false},{"column":25,"file":"net.js","function":"TCP.onread","line":615,"method":"onread","native":false}],"stack":["Error: read ECONNRESET"," at _errnoException (util.js:1024:11)"," at TCP.onread (net.js:615:25)"]}
Weirdly enough, this does not happen when then adb server is forced to run continuously e.g. via adb logcat.
Is there something we can do in regards to the server/client config to counteract this?

#2

Sorry i accidentally deleted your post, anyway i think this might be a sleep issue. I think the phone maybe going to sleep.

Are you using Windows 10 on the client? If so can you bring up Windows Device Manager then View -> Devices By Connection then under "VirtualHere USB 3.0 eXtensible Host Controller" look at the devices under there and right click Properties -> Power Management tab and UNcheck "Allow the Computer to Turn off this Device to Save Power"

#3

Yes, we are using Windows 10, but there is no Power Management tab under the device properties.
Also, the phone always stays unlocked, connected for usb debugging and showing the screen, plus there are actions constantly executed on the device during the tests until the sudden crash, so I doubt that it goes to sleep. The user running the tests on W10 also always stays logged in without going into sleep mode.

#4

What is the server? Is it a linux or windows machine? If it happens again in the VirtualHere client -> Right click USB Hubs-> System Messages, and can you see if it says a connection has dropped.