Well, I've made some significant progress on my MQTT Router. I've successfully brought 3 nodes online, 1 Primary and 2 Peers, and they are communicating Hellos and building connections between each other.
Here you see the Primary Router's output(Linux):
- Checks command line arguments (mode, local address/port, primary router address/port)
- Integrated client subscribes to it's local command feed (IP:Port)
- Integrated client ON Primary subscribes to the "Router-Hello" feed.
- Waits for peers to say Hi.
- Builds new connections to new Peers
- ReQs Hellos for each Router node on the network.
Peer Router #1(Windows):
- Checks command line arguments (mode, local address/port, primary router address/port)
- Integrated client subscribes to it's local command feed (IP:Port)
- Begins sending periodic Hellos to Primary Router Node
- Processes Hellos from other router nodes requeued by the Primary.
- Builds connections to other nodes.
- Monitors those connections by sending Ping Messages to calculate the RTT.
Peer Router #2(Windows):
- Same as Peer1
Here's what the ping output looks like(I had to get rid of some console output to see all the hellos and get them working right.)
So, now that my routers know where everybody is, and how long it takes to get there. All I need to do now is iron out the message "routing" bits and these things will actually be dynamic routers for the MQTT protocol... I'm kinda pleased with myself so far.
You're probably still wondering what the hell I'm doing with this stuff... That's okay, I am too. Kinda.
I'm currently thinking of it as a Content Delivery Network. It allows me to push Content out to clients, but it also allows clients to publish/subscribe Content to/from Other Clients.
If I integrate this into my game client, it gives me an entirely separate data channel for content delivery, not to mention the peer-to-peer networking implications.
All for now, will share some code and an updated specification when they're moving messages.
This is coming along