gos

package module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 12 Imported by: 0

README

gos

Golang server

v1.1.0

  • 修正斷線重連 與 斷線,兩者過程中的資源釋放與變數重置
  • 允許透過傳遞 site(server id) 和 cid(連線 ID),將 A 伺服器的任務轉交給 B 伺服器處理,結束後再返還給 A 伺服器,並回覆客戶端

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(site int32, ip string, port int, socketType define.SocketType, onEvents base.OnEventsFunc) (ask.IAsker, error)

func CheckWorks

func CheckWorks(msg string, root *base.Work)

func Listen

func Listen(socketType define.SocketType, port int32) (ans.IAnswer, error)

func RunAns

func RunAns()

開始讀取數據與處理

func RunAsk

func RunAsk()

func SendRequest added in v1.1.0

func SendRequest(req *ghttp.Request, callback func(*ghttp.Context)) (int32, error)

傳送 http 訊息

func SendToClient

func SendToClient(port int32, cid int32, data *[]byte, length int32) error

func SendToServer

func SendToServer(serverId int32, data *[]byte, length int32) error

func StartConnect

func StartConnect() error

開始所有已註冊的監聽

func StartListen

func StartListen()

開始所有已註冊的監聽

Types

This section is empty.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL