Package Socket:

- fix tcp,udp,unix socket
- add socket unixgram for session less unix socket
- optmize process & code
- add some standalone test for server / client (add example server config for
  rsyslog)

Package Network/Protocol:
- add unixgram protocol

Package Errors:
- fix bug in loop to prevent circular include
This commit is contained in:
nabbar
2024-01-28 08:20:05 +01:00
parent db0a79e2e7
commit c66a00917a
51 changed files with 2114 additions and 648 deletions

View File

@@ -32,6 +32,8 @@ package unix
import (
"sync/atomic"
libsiz "github.com/nabbar/golib/size"
libsck "github.com/nabbar/golib/socket"
)
@@ -39,21 +41,19 @@ type ClientUnix interface {
libsck.Client
}
func New(buffSizeRead int32, unixfile string) ClientUnix {
func New(buffSizeRead libsiz.Size, unixfile string) ClientUnix {
var (
a = new(atomic.Value)
s = new(atomic.Int32)
)
a.Store(unixfile)
s.Store(buffSizeRead)
s.Store(buffSizeRead.Int32())
return &cltx{
a: a,
s: s,
e: new(atomic.Value),
i: new(atomic.Value),
tr: new(atomic.Value),
tw: new(atomic.Value),
return &cli{
a: a,
s: s,
e: new(atomic.Value),
i: new(atomic.Value),
}
}