简体   繁体   中英

Best way to communicate through sockets

I am developing a client/server application, the client is written in c# and the server with go. They communicate through TCP sockets. I'd like to have something likes routing of REST to delegate request of the clients on specific routine, what is the best way to send this information/handle this message? Because sockets only sends binary message, I should send something like nameServices:data and a switch case on server to forwarding messagges? Thanks for your advices

You should use something like Protocol Buffers which is supported by Go and C#.

For the communications I suggest GRPC.

GRPC is a transport mechanism that sends and receives messages (protocol buffers) between two systems. The two parties are referred to as server and client.

Read more about GRPC and how to implement it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM