mirror of
https://github.com/nabbar/golib.git
synced 2025-10-05 15:56:50 +08:00
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:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user