Following on this question: http://stackoverflow.com/questions/3143075/connect-to-windows-app-with-webrequest , I decided to implement a simple web server type thing on my client app to receive the webrequest's.
Basically on the client app I have a listening socket and when it receives a connection it does something with the data and then returns a result. Receiving the data actually works, but once I have processed it I need to send a result back to the phone which send the webrequest.
I tried with the code below and although it does return the data(for instance if i goto the address in firefox it displays the success message) it never gets back to the phone. I dont know where it is going wrong.
if (mySocket.Connected)
{
if ((numBytes = mySocket.Send(bSendData, bSendData.Length, 0)) == -1)
listBox1.Items.Add("Socket Error cannot Send Packet");
}
and mySocket is the original socket that I received the connection on.
Is there a specific way I need to return the result? The callback even on the phone isnt even firing. But I think I am sending back the data correctly as a webbrowser does get the response.
Thanks!