Nutomic/ensichat

TCP API Interface

deavmi opened this issue · 5 comments

I was thinking of a really cool idea.

What if you could include a piece of code that could run a multi-threaded TCP server to handle requests from other apps that want to communicate to other apps that are on another phone on the EnsiChat mesh.

Like so:

Phone 1 has an app that say now sends messages.
Phone 1 wants to send a message to the same app on user's Phone 2.

Phone 1's app then makes a TCP connection to the local TCP server on port 6969 and then via a protocol designed by @Nutomic - it can take that data and send it over the mesh via your bluetooth + internet routing protocol and then to the device specified in the packet sent to EnsiChat TCP server. Once received it can then send the data back from EnsiChat on Phone 2 to the required app by sending a data message via TCP to the app.

This is just an idea, however you would like to implement a "Router API" is up to you. I just think it would be neat to see apps using your protocol to transfer information other than EnsiChat's.

This is certainly doable, by extending the core library and implementing a server that wraps the public API. But it's not something I have the time or interest to do.

If you want to implement this, go ahead and I will try to help you! Although it should probably go into a seperate repo.

A separate repo would be good. And if I knew Scala then maybe I could implement it. Scala seems fun - so why should I not learn it :).

My idea is this then. Create a new repo and use the core library (is it user friendly for communicating with other devices on the mesh) as part of this TCP interface.

The reason I say TCP is because it is implementable from anywhere.

I'm personally not sure if a TCP interface is so useful, I think there are many things in Ensichat itself that should be improved first. But if that's what you want to do, I won't stop you ;)

For communication about your implementation, its probably best if you open relevant issues, or write mails (my address is "me" @ my domain).

Okay. :)