Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket symmetry #7

Open
jonathanvanschenck opened this issue Nov 16, 2021 · 3 comments
Open

Socket symmetry #7

jonathanvanschenck opened this issue Nov 16, 2021 · 3 comments

Comments

@jonathanvanschenck
Copy link
Contributor

Right now, the socket's which get tracked by the server are just raw net Socket instances, while on the client, we get the nice wrapping with the ATCPClient class. It would be nice if one of three things happened:

  1. the ATCPClient was changed to become a superset of the net socket (right now, methods like "end" and "disconnect" aren't consistent with the builtin net package)
  2. the sockets tracked by the server were wrapped in something like the ATCPClient, so that they had the same interface as the clients
  3. Both the ATCPClient and the server-side sockets were wrapped -- this one is probably my favorite, because then we can move the session into the server-side socket's wrapper, which cleans up the code base, and makes interactions with the end-user a little nicer.
@jonathanvanschenck
Copy link
Contributor Author

Possibly for a 2.0.0 release?

@jonathanvanschenck
Copy link
Contributor Author

Also, with the addition of SockhopSessions, we are moving away from using raw sockets anyway.
However, keeping track of pings and response promises is a bit weird, and it would be nice to attach these to the socket somehow (since they aren't really intended for the end-user to interact with, they don't really belong in the Sesison)

@jonathanvanschenck
Copy link
Contributor Author

Well, it would also be nice if the session were also the things that emitted the received/request events too -- that way someone can work directly with the sessions and never have to deal with the server directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant