lxzan / gws

simple, fast, reliable websocket server & client, supports running over tcp/kcp/unix domain socket. keywords: ws, proxy, chat, go, golang...
https://pkg.go.dev/github.com/lxzan/gws
Apache License 2.0
1.34k stars 84 forks source link

I'm curious about the Close() method in GWS messaging #67

Closed heojeong0141 closed 9 months ago

heojeong0141 commented 9 months ago

Do I always need to close the message? It seems different from closing a connection, and I'm not sure about it. Please explain, as it will be used in a chat application.

heojeong0141 commented 9 months ago

Additionally, I'm curious if it's compatible with external libraries, such as websockets in react-native or flutter.

lxzan commented 9 months ago

It should be closed after it has been used. This helps to reduce gc stress and lower memory usage.

lxzan commented 9 months ago

Additionally, I'm curious if it's compatible with external libraries, such as websockets in react-native or flutter.

Compatible. websocket protocol has a unified standard.

heojeong0141 commented 9 months ago

Thank you for being a great developer, and also for your kind explanations