This issue can be caused by a port being blocked by Windows Firewall.
Your app is communicating through port (insert port number here) on the virtual device via local host, IP address or fully qualified domain, but your actual devices will not connect.
Your port is most likely being blocked by Windows Firewall, and you will need to set an inbound/outbound rule. Outbound rule is most likely not necessary, but a good rule of thumb to set a rule for both.
Open Windows Firewall through the control panel, and click on Advanced Settings.
Click on Inbound Rules, and then New Rule
Select the Port radio button, and then Next
Select TCP radio button, Specific local ports radio button, type the port number you are using to connect with your app in the text field and click Next
Select Allow the connection radio button and click Next
Apply the rule to desired Network connection types and click Next
Give the rule a name and description if desired and click Finished
Repeat the steps for an outbound rule substituting outbound for inbound