You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
376 B
25 lines
376 B
package subject |
|
|
|
import ( |
|
"github.com/gorilla/websocket" |
|
"log" |
|
) |
|
|
|
// NetClient 长连接客户端 |
|
type NetClient struct { |
|
Id int64 |
|
Conn *websocket.Conn |
|
} |
|
|
|
func (c *NetClient) Close(reason string) { |
|
err := c.Conn.Close() |
|
if err != nil { |
|
log.Println("Close Error", err) |
|
} |
|
} |
|
|
|
func NewNetClient(conn *websocket.Conn) *NetClient { |
|
return &NetClient{ |
|
Conn: conn, |
|
} |
|
}
|
|
|