Multiple applications sharing a single system-wide socket
I'm trying to develop a network library in my free time. I read a lot
about how to do it and I was impressed by an idea from UDT were any number
of applications can use a single port on a machine.
I got the basic socket interaction working already. What I plan to do now
is to create a class that is in charge for routing incoming messages to
the application that had previously registered its protocol number with
it. If there is no application for the received package, it is dropped.
What I want to achieve is that a chat program may run next to an MMOG
client may run next to a data transfer pipeline, all sharing the same port
and application base. They just have to retrieve a reference to the
"Connection Manager" (I'm using UDP as transportation, so "connections" is
not the correct term), register the protocol ID with it and are informed
about incoming messages and may send messages this way.
Since I'm working on this in C# for .NET/Mono 4.0+, how would I implement
a similar approach? Is COM a way or is the CLI implementing such a thing
in a platform independent manner?
For anyone interested in sources: I develop this on GitHub and could use
some extra pair of eyes ;)
No comments:
Post a Comment