WebSocket WCF Transport Binding

I recently discovered WebSockets and their possible use in my project. I am currently using raw web sockets, but I was exploring the possibility of creating a custom transport binding / channel that would handle everything and allow me to host it in IIS.

I started working on this, but I am having trouble figuring out how to get IIS to redirect me the appropriate requests. I read an example of the UDP transport from Microsoft, but it does not support it as I do, so it is not very useful in this regard. In the example, a UDP socket is created in the WCF code itself, which does not seem to be the correct way to execute it. I could manually bind my own port for listening, but then I would have to reimplement things that are covered by IIS / ASP.NET.

Since WebSocket starts as a normal HTTP request, it grows into a protocol similar to HTTP, I need to get IIS to give me a stream from which I can read and write.

I am using .NET Reflector to view webHttpBinding to see how they do it. They seem to be using httpapi.dll for the P / Invoke HttpCreateRequestQueue. Is that what I want?

This is very similar to webBindingSocket in such a way that it creates client-side JavaScript proxy code, but I will automatically create callback methods so that the server can easily call methods in the browser.

Example:
http: //localhost/WebSocket.svc - Metadata Service


http: //localhost/WebSocket.svc/jsdebug - JavaScript client client
http: //localhost/WebSocket.svc/stream - Where is WebSocket

I apologize if my question seems confusing, but I just looked at tons of code trying to figure out how this works. Basically, I want to make it easier to use WebSockets in my code, instead of worrying about serializing messages to / from the server and calling the correct method, I will handle everything in WCF.

thanks

+4
source share
2 answers

Microsoft is working on implementing WebSocket, for more information see: http://blogs.msdn.com/b/interoperability/archive/2010/12/21/introducing-the-websockets-prototype.aspx

The WCF / Web team publishes an update on their Codeplex website here: http://wcf.codeplex.com/

- larsw

0
source
0
source

All Articles