Closed Andrey36652 closed 7 months ago
Oh, I thought "Concurrent & Asynchronous Non-Blocking Write" applies only to method WriteAsync. So, this statement applies to all of the WriteMessage, WritePing, WritePong, SetDeadline, WriteClose methods, right?
yes
gws generates a full websocket frame each time it writes, and net.Conn has an internal lock, so developers don't have to lock again when using gws
net.Conn has an internal lock
Is this implementation platform independent? i.e. same behaviour on Windows, Linux, macos?
It should be consistent, gws does implementations based on the standard network library
Thanks
Hello, I'm considering usage of gws as a websocket client library. I want to ask: is it safe to call methods WriteMessage, WritePing, WritePong, SetDeadline, WriteClose of same gws.Conn concurrently from distinct goroutines?
Example:
Or should I wrap with mutex each call of those methods?