Zinx版本0.1

    xiaoxiao2022-07-07  206

    Zinx-V0.1

    抽象层

    Server模块的抽象层

    type IServer interface {

    ​ //启动服务器

    ​ //停止服务器

    ​ //运行服务器

    }

    type IServer interface { Serve() Close() Start() }
    server模块
    属性

    ip版本

    监听ip(0.0.0.0 全网监控)

    监听端口

    名称

    type Server struct { IPVersion string IP string Port int Name string }
    方法

    初始化Server模块的方法

    启动服务器

    启动server的监听功能

    1.创建套接字 2.监听服务器地址 3.阻塞等待客户端发送请求 4.客户端有数据请求,处理客户端业务(读写)

    关闭服务器

    运行服务器

    最新回复(0)