style: 错误的命名更正
This commit is contained in:
parent
08559d8225
commit
1558b2868d
|
@ -16,7 +16,7 @@ func NewWebsocket(addr string) *Client {
|
||||||
type Websocket struct {
|
type Websocket struct {
|
||||||
addr string
|
addr string
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
clsoed bool
|
closed bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (slf *Websocket) Run(runState chan<- error, receive func(wst int, packet []byte)) {
|
func (slf *Websocket) Run(runState chan<- error, receive func(wst int, packet []byte)) {
|
||||||
|
@ -26,9 +26,9 @@ func (slf *Websocket) Run(runState chan<- error, receive func(wst int, packet []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
slf.conn = ws
|
slf.conn = ws
|
||||||
slf.clsoed = false
|
slf.closed = false
|
||||||
runState <- nil
|
runState <- nil
|
||||||
for !slf.clsoed {
|
for !slf.closed {
|
||||||
messageType, packet, readErr := ws.ReadMessage()
|
messageType, packet, readErr := ws.ReadMessage()
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
panic(readErr)
|
panic(readErr)
|
||||||
|
@ -45,7 +45,7 @@ func (slf *Websocket) Write(packet *Packet) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (slf *Websocket) Close() {
|
func (slf *Websocket) Close() {
|
||||||
slf.clsoed = true
|
slf.closed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (slf *Websocket) GetServerAddr() string {
|
func (slf *Websocket) GetServerAddr() string {
|
||||||
|
|
Loading…
Reference in New Issue