Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safe? #15

Open
blackrosezy opened this issue Jun 2, 2021 · 0 comments
Open

Thread safe? #15

blackrosezy opened this issue Jun 2, 2021 · 0 comments

Comments

@blackrosezy
Copy link

Is gowebsocket.Socket thread safe? Can I do something like this?

func foo(socket gowebsocket.Socket){
  log.Println("Connected to server");
  socket.SendText("Hi there, this is my sample test message")
}

...

socket.OnConnected = func(socket gowebsocket.Socket) {
  go foo(socket)
}

This is just an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant