Score:0

How to fix "The requested address is not valid in its context" for a windows executable?

jp flag

I am trying to run a self-compiled windows application on windows 10 in powershell (with and without admin rights) which need access to a network adapter at address 192.168.200.6 so I run it as

.\my_app.exe 192.168.200.6

but I get an error

[ERROR] (10049): The requested address is not valid in its context.

I can ping that address from the powershell. I also added that app to the "public" and "private" firewall setting in "Allow an app through firewall" but I still get that error.

This question is not about programming and coding, it is about WINDOWS and what else I might configure on WINDOWS so WINDOWS allows this application to run without any further restrictions?

cn flag
"The reason for why your code fails tho is because you're trying to bind to an external IP. Your machine is not aware of this IP hence the error message, [...]. In other words, you mixed up client sockets with server sockets and you're binding to a IP not present on the local machine." https://stackoverflow.com/questions/23857942/winerror-10049-the-requested-address-is-not-valid-in-its-context
jp flag
But that IP belongs to an adaptor that is defined in the "Network Connections" settings in Windows. It is identified as "Ethernet 2", a "Realtek USB GbE Family Controller" configured with a static IP address 192.168.200.6 with a subnet mask of 255.255.255.0. It seems to be enabled and I can ping it and devices connected to that very ethernet adaptor. So windows knows about this device. And thanks a lot for your answer, I will take a look at the link you provided right away. In other SO forums you will be indiscriminated for asking such a question!
cn flag
The response is commensurate with the information presented in the question. Normally I would inquire further, however given the attitude regarding the lack of context, and that this is a forum for managing systems in a business environment, this question is most likely better handled in another forum.
jp flag
Just say when you have no further idea of the cause of the problem. Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.