gnet-io / gnet-examples

Examples of gnet
MIT License
245 stars 77 forks source link

Replace the std client with gnet client in custom_codec example #10

Closed wathenjiang closed 2 years ago

wathenjiang commented 2 years ago

As Gnet client is now available for production, we could use client in gnet instead.

But I'm not 100% sure I use client.go correctly, please let me know if there are any mistakes.

panjf2000 commented 2 years ago

You provide nothing here and expect me to pick up mistakes?

wathenjiang commented 2 years ago

You provide nothing here and expect me to pick up mistakes?

I means you uesed smallnest/goframe to implement a tcp client, but now cloud use client in gnet.

You not yet provided a quite simple client example in gnet.

panjf2000 commented 2 years ago

Oh sorry, this is a PR, I thought it's an issue.

panjf2000 commented 2 years ago

Have you tested your new code? Did it work? @Spongecaptain

wathenjiang commented 2 years ago

@panjf2000 I have tested it and it worked well. Turning smallnest/goframe to client.go in gnet just a little bit amendment.

You can find commands by:

&&

panjf2000 commented 2 years ago

Why is go.mod changed so much? did you run go mod tidy before opening this PR? @Spongecaptain

wathenjiang commented 2 years ago

Why is go.mod changed so much? did you run go mod tidy before opening this PR? @Spongecaptain

I did run the go mod tidy.

panjf2000 commented 2 years ago

Thanks~