me when i dont use vcs properly
This commit is contained in:
+4
-4
@@ -4,7 +4,6 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
|
||||
"github.com/admin-else/strom/event"
|
||||
"github.com/admin-else/strom/proto"
|
||||
"github.com/admin-else/strom/proto_base"
|
||||
)
|
||||
@@ -12,6 +11,7 @@ import (
|
||||
func Servee(c net.Conn) (ret *proto.Conn) {
|
||||
ret = &proto.Conn{}
|
||||
ret.Version = "1.21.8"
|
||||
ret.ProtocolVersion = 772
|
||||
ret.State = proto_base.Handshaking
|
||||
ret.CompressionThreshold = -1
|
||||
ret.Actor = proto_base.Server
|
||||
@@ -21,17 +21,17 @@ func Servee(c net.Conn) (ret *proto.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
func ServeClient(cNet net.Conn, factory func(c *proto.Conn) (h event.HandlerInst, err error)) (err error) {
|
||||
func ServeClient(cNet net.Conn, factory func(c *proto.Conn) (h any, err error)) (err error) {
|
||||
c := Servee(cNet)
|
||||
h, err := factory(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = c.Start(h)
|
||||
err = c.StartOne(h)
|
||||
return
|
||||
}
|
||||
|
||||
func StartServerWithFactory(listenAddr string, factory func(c *proto.Conn) (h event.HandlerInst, err error)) (err error) {
|
||||
func StartServerWithFactory(listenAddr string, factory func(c *proto.Conn) (h any, err error)) (err error) {
|
||||
l, err := net.Listen("tcp", listenAddr)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user