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

os/gtime:I suggest adding a few additional flags to the GTCP protocol header #3541

Open
ayamzh opened this issue Apr 25, 2024 · 0 comments
Open

Comments

@ayamzh
Copy link

ayamzh commented Apr 25, 2024

Is your feature request related to a problem?

Option No

Describe the solution you'd like

I suggest adding a few additional flags to the GTCP protocol header in addition to the length parameter. These flags could include:

Compress (2 bits): Compression flag indicating whether the payload is compressed. 0 for no compression, 1 for gzip, 2 for other compression algorithms.
Serialize (2 bits): Serialization flag indicating the payload serialization scheme. 1 for JSON, 2 for Protocol Buffers.
Encrypt (1 bit): Encryption flag indicating whether the payload is encrypted. 0 for no encryption, 1 for AES encryption.
We are involved in game development, where it's common to include such flags in the protocol header. Both server and client can then unpack the payload according to the agreed-upon conventions. I suggest designing a codec interface within the framework to handle these tasks.

Describe alternatives you've considered

nothing

Additional

No response

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

No branches or pull requests

1 participant