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

ClientGCMsgProtobuf constructor with pre-allocated body #266

Open
paralin opened this issue Apr 11, 2016 · 3 comments
Open

ClientGCMsgProtobuf constructor with pre-allocated body #266

paralin opened this issue Apr 11, 2016 · 3 comments

Comments

@paralin
Copy link
Contributor

paralin commented Apr 11, 2016

Why is there no client send constructor for ClientGCMsgProtobuf that allows you to specify a pre-allocated Body?

I'd like to allocate the body object elsewhere and then pass it in for use in the ClientGCMsgProtobuf, rather than having to copy all the properties over to a new object.

@Netshroud
Copy link

Why can't you just allocate a ClientGCMsgProtobuf and pass that around?

@paralin
Copy link
Contributor Author

paralin commented Apr 12, 2016

@Netshroud Seems really messy, especially when Details contains everything I would need when storing this information.

This could be solved by just adding 1 more constructor that takes a pre-allocated body and sets this.Body to it.

@michaelvdnet
Copy link

You could write it like this:

var msg = ClientGCMsgProtobuf<...>(...)
{
    Body = <your body object>
};

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

5 participants