mirror of
https://github.com/xtaci/smux.git
synced 2024-04-21 10:51:48 +00:00
Update README.md
This commit is contained in:
@@ -55,8 +55,6 @@ STREAMID:
|
||||
|
||||
## Usage
|
||||
|
||||
The API of smux are mostly taken from [yamux](https://github.com/hashicorp/yamux)
|
||||
|
||||
```go
|
||||
|
||||
func client() {
|
||||
@@ -80,6 +78,8 @@ func client() {
|
||||
|
||||
// Stream implements io.ReadWriteCloser
|
||||
stream.Write([]byte("ping"))
|
||||
stream.Close()
|
||||
session.Close()
|
||||
}
|
||||
|
||||
func server() {
|
||||
@@ -104,6 +104,8 @@ func server() {
|
||||
// Listen for a message
|
||||
buf := make([]byte, 4)
|
||||
stream.Read(buf)
|
||||
stream.Close()
|
||||
session.Close()
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user