4 ms·
What does Go do that makes writing network protocols simple?
by cgag 12y ago
What does Go do that makes writing network protocols simple?
- skj 12y agoGo makes it straightforward to have one program efficiently communicating with many different servers and clients. It does this by having all network IO be event-based in such a way that it's effectively tied directly into the scheduler, and then communicating between the different goroutines managing all these connections is very easy.
- micro_cam 12y agoAll of the HTTP, socket, encryption, compression etc libraries have a really clean, consistent design based around stackable reader and writer interfaces. This makes it really easy to combine things, swap out transport layers etc. Go routines and channels are also nice for handling concurrent requests though I find myself using mutexes more than channels for finer grained control.