Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Move connection logic into Rust #2

Open
randomPoison opened this issue Feb 12, 2020 · 1 comment
Open

Move connection logic into Rust #2

randomPoison opened this issue Feb 12, 2020 · 1 comment
Labels
client Changes that affect the client codebase server Changes that specifically affect the server codebase shared Changes that affect the shared codebase

Comments

@randomPoison
Copy link
Owner

Currently we connect the client and server with a websocket using the warp crate. While this works, it requires us to effectively build our own RPC layer on top of the websockets API, which results in a lot of boilerplate and cumbersome code. It's especially painful right now because the client is using a C# websocket implementation, which means there's a lot of boilerplate around passing messages between Rust and C#.

Instead, we should move the client/server connection code fully into Rust and use tarpc as our RPC layer. This would greatly simplify client/server communication, and would allow us to remove the gross websocket package we're currently using.

@randomPoison randomPoison added client Changes that affect the client codebase server Changes that specifically affect the server codebase shared Changes that affect the shared codebase and removed enhancement labels May 24, 2020
@randomPoison randomPoison changed the title Switch to tarpc and move connection logic into Rust Move connection logic into Rust May 24, 2020
@randomPoison
Copy link
Owner Author

Right now tarpc doesn't support two-way communication between client and server: The client can send the server requests, but the server can't send the client requests/messages. This is a potential problem for us, since the match flow requires the server be able to send match updates to the client. I'd like to avoid using something like long polling to accomplish this, and in the long-run we're going to want our network framework to support proper server-sent events in some for or another.

As such, I'm tweaking the focus of this ticket to primarily be about moving the communication layer into the shared Rust code. Doing this with tarpc would be ideal, but even if we keep using websockets it will still be better to do so from Rust than from C#.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
client Changes that affect the client codebase server Changes that specifically affect the server codebase shared Changes that affect the shared codebase
Projects
None yet
Development

No branches or pull requests

1 participant