aceld / aceld/zinx

请问我按照readme里面运行服务报错

Đang mở
#37 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
7.8k
Fork
1.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

[root@server ]$ go run main.go server.go
go: finding github.com/aceld/zinx/ziface latest
go: finding github.com/aceld/zinx latest
go: finding github.com/aceld/zinx/znet latest
go: downloading github.com/aceld/zinx v0.0.0-20191210110905-0a663b2d6b15
go: extracting github.com/aceld/zinx v0.0.0-20191210110905-0a663b2d6b15
build command-line-arguments: cannot load zinx/utils: cannot find module providing package zinx/utils

package main

import (
"github.com/aceld/zinx/znet"
)

func main() {
//1 创建一个server句柄
s := znet.NewServer()

//2 配置路由
s.AddRouter(0, &PingRouter{})

//3 开启服务
s.Serve()
}

package main

import (
"fmt"

"github.com/aceld/zinx/ziface"
"github.com/aceld/zinx/znet"
)

type PingRouter struct {
znet.BaseRouter
}

func (this *PingRouter) Handle(request ziface.IRequest) {
fmt.Println("recv from client : msgId=", request.GetMsgID(), ", data=", string(request.GetData()))

err := request.GetConnection().SendBuffMsg(0, []byte("ping...ping...ping"))
if err != nil {
fmt.Println(err)
}
}

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.