3 Commits

Author SHA1 Message Date
f17bcbf046 Merge pull request #206 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.11.43
All checks were successful
test / test (push) Successful in 3m40s
Bump go.unistack.org/micro/v3 from 3.11.37 to 3.11.43
2025-04-29 03:08:29 +03:00
dependabot[bot]
8af0ad942d Bump go.unistack.org/micro/v3 from 3.11.37 to 3.11.43
Bumps go.unistack.org/micro/v3 from 3.11.37 to 3.11.43.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-version: 3.11.43
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-29 00:08:09 +00:00
cd84ab56af update for latest micro
All checks were successful
test / test (push) Successful in 1m58s
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2025-01-15 13:06:43 +03:00
3 changed files with 13 additions and 11 deletions

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.23.4
require (
go.unistack.org/micro/v3 v3.11.37
go.unistack.org/micro/v3 v3.11.43
golang.org/x/net v0.34.0
)

4
go.sum
View File

@@ -21,8 +21,8 @@ github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
go.unistack.org/micro-proto/v3 v3.4.1 h1:UTjLSRz2YZuaHk9iSlVqqsA50JQNAEK2ZFboGqtEa9Q=
go.unistack.org/micro-proto/v3 v3.4.1/go.mod h1:okx/cnOhzuCX0ggl/vToatbCupi0O44diiiLLsZ93Zo=
go.unistack.org/micro/v3 v3.11.37 h1:ZcpnXAYEMcAwmnVb5b7o8/PylGnILxXMHaUlRrPmRI0=
go.unistack.org/micro/v3 v3.11.37/go.mod h1:POGU5hstnAT9LH70m8FalyQSNi2GfIew71K75JenIZk=
go.unistack.org/micro/v3 v3.11.43 h1:+zIt+NjMhHHNbOpllQVilz96UWV5qsSGV+JFgTC4xFM=
go.unistack.org/micro/v3 v3.11.43/go.mod h1:POGU5hstnAT9LH70m8FalyQSNi2GfIew71K75JenIZk=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=

18
tcp.go
View File

@@ -1,5 +1,5 @@
// Package tcp implements a go-micro.Server
package tcp // import "go.unistack.org/micro-server-tcp/v3"
package tcp
import (
"context"
@@ -16,7 +16,7 @@ import (
"go.unistack.org/micro/v3/logger"
"go.unistack.org/micro/v3/register"
"go.unistack.org/micro/v3/server"
msync "go.unistack.org/micro/v3/sync"
"golang.org/x/net/netutil"
)
@@ -62,6 +62,9 @@ func (h *Server) Options() server.Options {
}
func (h *Server) Init(opts ...server.Option) error {
if h.opts.Wait == nil {
h.opts.Wait = msync.NewWaitGroup()
}
if len(opts) == 0 && h.init {
return nil
}
@@ -486,15 +489,14 @@ func (h *Server) serve(ln net.Listener, hd Handler) {
return
}
if err != nil {
config.Logger.Error(config.Context, "tcp: accept err", err)
return
if h.opts.Wait != nil {
h.opts.Wait.Add(1)
}
h.opts.Wait.Add(1)
go func() {
hd.Serve(c)
h.opts.Wait.Done()
if h.opts.Wait != nil {
h.opts.Wait.Done()
}
}()
}
}