I'm happy to provide any code necessary, but in my original post I
included the entire callback method. I'm not sure what else would be
relevant. I show how I use the stream in the posted code in this line:
ProcessReceived(ipAddress, reader.ReadToEnd());
The only other code that I could see being relevant would be how I
declare the listener:
m_HttpListener = new HttpListener();
m_HttpListener.AuthenticationSchemes =
AuthenticationSchemes.Anonymous;
m_HttpListener.Prefixes.Add(String.Format("http://{0}:{1}/",
Utility.GetLocalIP(), GetFailoverPort()));
m_HttpListener.Start();
m_HttpListenerCallback = new AsyncCallback(ListenerCallback);
m_HttpListener.BeginGetContext(m_HttpListenerCallback,
m_HttpListener);
and the embedded code that sends the request (written in C++):
http://pastebin.com/m52b84df8
Here is the original code that I posted as well (since I believe it
has been taken down from the other paste site):
http://pastebin.com/m29683096
and here is what is received (retrieved via SmartSniff):
POST / HTTP/1.1
Host:
10.0.100.74:21559
Content-Length: 213
Expect: 100-continue
<Channel>
<Number>3</Number>
<Voltage>22.6738</Voltage>
<Current>0.456184</Current>
<FailoverState>1</FailoverState>
<VoltageState>audio</VoltageState>
<CurrentState>audio</CurrentState>
</Channel>
It only seems to happen every now and then, both the "Incorrect
Function" "Parameter is Incorrect" and the random ASCII 001 insertion
problem. Do the HTTP requests appear to be properly formed? Is there
some other code I should be providing? I really think I've covered all
sections that deal with the HTTP communications.
Thank you for your responses and your help.