?

Log in


tobes31415 in tobes31415_code

Network Layer Rewrite

I recently have taken a second look at the networking issues I'd face in my three ongoing projects. While I'd previously posted I had a working network layer I've decided I can do better, so I reviewed all the code I'd written, extracted the 'why' in what was there and now I'm starting it from scratch. As a big Woot my first sub-component, an in-memory stream for buffering between threads, I got it transferring 2Gb of data in 600 milliseconds, verses 12000 milliseconds for the Queue class which is the closest analogue I could find. I felt really good after I'd verified the numbers. And its all using managed code too :) So without a doubt there was much room for improvement, the new design is also much simpler and more elegant.

I wonder though if I might be suffering from the "Not invented here syndrome" with this network layer I'm writing. Windows XP has an installable P2P network protocol, PNRP. As well the Windows Communication Framework has P2P support too. My justification for doing this anyway is that use of the PNRP protocol requires an additional windows-only installation which would be like pulling teeth to get some people to install, exclude non-windows platforms, and since no one is using it I'm not sure of it's even reliable. The WCF features sound amazing, but the caveat is that all the uber cool .Net 3.5 WCF examples I've looked at seem to involve WAAAY to much configuration and meta data just to run. I don't want to mess around with addressing, contracts, and bindings for every small networked application I write just so I can send a few bytes of data. My network layer would use TCP P2P (Only one binding) stream based (no contract management), and available services/endpoints listed as objects at run time (no addressing required). No built in serialization or communication management either, just a byte stream between processes. less powerful than WCF, but sufficient for most of what I want to use it for.

-- UPDATE --
Actually it looks like the WCF P2P support requires you to have PNRP installed anyway... so nvm I guess. Since I don't want to use PNRP I do actually need my own P2P network component.

Comments

Actually it looks like the WCF P2P support requires you to have PNRP installed anyway... so nvm I guess.

January 2009

S M T W T F S
    123
45678910
11121314151617
18192021222324
25262728293031
Powered by LiveJournal.com