Пример #1
0
func socketHandler(inst *wsock.SocketInstance, length int64, data io.Reader) error {
	d := make([]byte, length)
	data.Read(d)
	fmt.Printf("Message: %q\n", d)
	inst.Write(d)
	return nil
}
Пример #2
0
func socketConnectionHandler(inst *wsock.SocketInstance) error {
	err := inst.ReadLoop()
	fmt.Printf("connection closed %q\n", err)
	return err
}