Im trying to run a webserver on a Cobra II with onboard wifi. My goal is to run the server with no external router, so ad-hoc. The Cobra will be gathering data, and the idea is to access a webpage (or a custom socket connection) and display the data on a phone/webbrowser.
The adhoc setup runs fine from what I can see, but when trying to run a server or bind a socket, I start to get exceptions. I dont know if the ip 0.0.0.0 is invalid. If I use it, the socket will bind with no exception, but throw at .Accept() … Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1)… #### SocketException ErrorCode = 10050.
If I use a valid ip, ex 192.168.1.1 I get the same exception when binding
Socket listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Bind the listening socket to the port IPAddress hostIP = IPAddress.Parse(NI.IPAddress); IPEndPoint ep = new IPEndPoint(hostIP, 80); listenSocket.Bind(ep);
Has anyone tried this type of setup with this card? If there is a better way to solve the problem, Id be glad to hear.