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

x/net/websocket: Document goroutine safety of websocket.Conn #6692

Closed
cskr opened this issue Oct 30, 2013 · 5 comments
Closed

x/net/websocket: Document goroutine safety of websocket.Conn #6692

cskr opened this issue Oct 30, 2013 · 5 comments

Comments

@cskr
Copy link

cskr commented Oct 30, 2013

The documentation of websocket.Conn[1] does not state that it is safe to share it among
multiple goroutines. From the implementation (rio and wio mutexes), it appears that it
is safe.

It'll be convenient if this is explicitly stated like in the case of net.Conn in
stdlib[2].

[1] - http://godoc.org/code.google.com/p/go.net/websocket#Conn
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-net.

@gopherbot
Copy link

Comment 4 by everton.marques:

Found this:
http://stackoverflow.com/questions/10986008/is-websocket-send-receive-thread-safe-go-routine-safe
"Yes, you can call Send, Receive and Close on a websocket connection concurrently, like
you can with all net.Conn's in Go. A short excerpt from the official docs:"
Multiple goroutines may invoke methods on a Conn simultaneously.

@cskr cskr added new labels Apr 19, 2014
@bradfitz bradfitz removed the new label Dec 18, 2014
@mikioh mikioh changed the title go.net/websocket: Document goroutine safety of websocket.Conn x/net/websocket: Document goroutine safety of websocket.Conn Dec 23, 2014
@mikioh mikioh added repo-net and removed repo-net labels Dec 23, 2014
@mikioh mikioh changed the title x/net/websocket: Document goroutine safety of websocket.Conn websocket: Document goroutine safety of websocket.Conn Jan 4, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title websocket: Document goroutine safety of websocket.Conn x/net/websocket: Document goroutine safety of websocket.Conn Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-net label Apr 14, 2015
@mikioh
Copy link
Contributor

mikioh commented Mar 9, 2016

Fixed: golang/net@3e5cd1e

@mikioh mikioh closed this as completed Mar 9, 2016
@golang golang locked and limited conversation to collaborators Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants