mirror of https://github.com/gorilla/websocket.git
Improve documentation
This commit is contained in:
parent
d14d8b4715
commit
423912737d
11
doc.go
11
doc.go
|
@ -97,10 +97,13 @@
|
||||||
//
|
//
|
||||||
// Concurrency
|
// Concurrency
|
||||||
//
|
//
|
||||||
// Connections do not support concurrent calls to the write methods
|
// Connections support one concurrent reader and one concurrent writer.
|
||||||
// (NextWriter, SetWriteDeadline, WriteMessage) or concurrent calls to the read
|
//
|
||||||
// methods methods (NextReader, SetReadDeadline, ReadMessage). Connections do
|
// Applications are responsible for ensuring that no more than one goroutine
|
||||||
// support a concurrent reader and writer.
|
// calls the write methods (NextWriter, SetWriteDeadline, WriteMessage,
|
||||||
|
// WriteJSON) concurrently and that no more than one goroutine calls the read
|
||||||
|
// methods (NextReader, SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler,
|
||||||
|
// SetPingHandler) concurrently.
|
||||||
//
|
//
|
||||||
// The Close and WriteControl methods can be called concurrently with all other
|
// The Close and WriteControl methods can be called concurrently with all other
|
||||||
// methods.
|
// methods.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Command example
|
# Command example
|
||||||
|
|
||||||
This example connects a websocket connection to stdin and stdout of a command.
|
This example connects a websocket connection to stdin and stdout of a command.
|
||||||
Received messages are written to stdin followed by a `\\n`. Each line read from
|
Received messages are written to stdin followed by a `\n`. Each line read from
|
||||||
from standard out is sent as a message to the client.
|
from standard out is sent as a message to the client.
|
||||||
|
|
||||||
$ go get github.com/gorilla/websocket
|
$ go get github.com/gorilla/websocket
|
||||||
|
@ -14,6 +14,6 @@ Try the following commands.
|
||||||
# Echo sent messages to the output area.
|
# Echo sent messages to the output area.
|
||||||
$ go run main.go cat
|
$ go run main.go cat
|
||||||
|
|
||||||
# Run a shell.Try sending `ls` and `cat main.go`.
|
# Run a shell.Try sending "ls" and "cat main.go".
|
||||||
$ go run main.go sh
|
$ go run main.go sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue