Use a WebSocketManager for all WebSocket connections #81

Closed
opened 4 months ago by kimimaru · 2 comments
Owner

Create a WebSocketManager to manage WebSocket server and client connections across the project.

Create a `WebSocketManager` to manage WebSocket server and client connections across the project.
kimimaru added this to the TRBot 2.4 project 4 months ago
kimimaru added the
refactor
label 4 months ago
Poster
Owner

The server is complete and should yield both better performance due to having a single server and cleaner code since the WebSocket library is abstracted into a new TRBot.WebSocket project.

Further abstract the implementation by handling the WebSocket clients, and create a new WebSocketService that derives from WebSocketSharp.Server.WebSocketBehavior. Use the latter in IWebSocketManager.AddServerService and IWebSocketManager.RemoveServerService.

Lastly, the WebSocketManager implementation is going to be large once clients are handled. Make WebSocketManager a standalone class, then add IWebSocketServerManager and IWebSocketClientManager along with implementations that are injected into WebSocketManager.

The server is complete and should yield both better performance due to having a single server and cleaner code since the WebSocket library is abstracted into a new `TRBot.WebSocket` project. Further abstract the implementation by handling the WebSocket clients, and create a new `WebSocketService` that derives from `WebSocketSharp.Server.WebSocketBehavior`. Use the latter in `IWebSocketManager.AddServerService` and `IWebSocketManager.RemoveServerService`. Lastly, the `WebSocketManager` implementation is going to be large once clients are handled. Make `WebSocketManager` a standalone class, then add `IWebSocketServerManager` and `IWebSocketClientManager` along with implementations that are injected into `WebSocketManager`.
Poster
Owner

WebSocket clients are used in only a few locations in the project and each use requires specific needs, so I don't think it's worth changing them right now. It can be reconsidered if we change to another WebSocket library or add more WebSocket clients.

WebSocket clients are used in only a few locations in the project and each use requires specific needs, so I don't think it's worth changing them right now. It can be reconsidered if we change to another WebSocket library or add more WebSocket clients.
kimimaru closed this issue 3 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.