Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
cf94b2f9
Commit
cf94b2f9
authored
5 years ago
by
Huxing Zhang
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #96 from divebomb/master
Fix: alexstocks/getty issue 18
parents
38b7dd8d
1573e98d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocol/dubbo/readwriter.go
+5
-6
5 additions, 6 deletions
protocol/dubbo/readwriter.go
protocol/dubbo/server.go
+6
-2
6 additions, 2 deletions
protocol/dubbo/server.go
with
11 additions
and
8 deletions
protocol/dubbo/readwriter.go
+
5
−
6
View file @
cf94b2f9
...
...
@@ -24,7 +24,7 @@ import (
import
(
"github.com/dubbogo/getty"
"github.com/dubbogo/hessian2"
hessian
"github.com/dubbogo/hessian2"
perrors
"github.com/pkg/errors"
)
import
(
...
...
@@ -89,12 +89,11 @@ func (p *RpcClientPackageHandler) Write(ss getty.Session, pkg interface{}) error
// RpcServerPackageHandler
////////////////////////////////////////////
type
RpcServerPackageHandler
struct
{
}
var
(
rpcServerPkgHandler
=
&
RpcServerPackageHandler
{}
)
func
NewRpcServerPackageHandler
()
*
RpcServerPackageHandler
{
return
&
RpcServerPackageHandler
{}
}
type
RpcServerPackageHandler
struct
{}
func
(
p
*
RpcServerPackageHandler
)
Read
(
ss
getty
.
Session
,
data
[]
byte
)
(
interface
{},
int
,
error
)
{
pkg
:=
&
DubboPackage
{
...
...
This diff is collapsed.
Click to expand it.
protocol/dubbo/server.go
+
6
−
2
View file @
cf94b2f9
...
...
@@ -79,6 +79,8 @@ type Server struct {
conf
ServerConfig
tcpServer
getty
.
Server
exporter
protocol
.
Exporter
rpcHandler
*
RpcServerHandler
}
func
NewServer
(
exporter
protocol
.
Exporter
)
*
Server
{
...
...
@@ -88,6 +90,8 @@ func NewServer(exporter protocol.Exporter) *Server {
conf
:
*
srvConf
,
}
s
.
rpcHandler
=
NewRpcServerHandler
(
s
.
exporter
,
s
.
conf
.
SessionNumber
,
s
.
conf
.
sessionTimeout
)
return
s
}
...
...
@@ -116,8 +120,8 @@ func (s *Server) newSession(session getty.Session) error {
session
.
SetName
(
conf
.
GettySessionParam
.
SessionName
)
session
.
SetMaxMsgLen
(
conf
.
GettySessionParam
.
MaxMsgLen
)
session
.
SetPkgHandler
(
NewR
pcServerP
ackage
Handler
()
)
session
.
SetEventListener
(
NewRpcServerHandler
(
s
.
exporter
,
conf
.
SessionNumber
,
conf
.
sessionTimeout
)
)
session
.
SetPkgHandler
(
r
pcServerP
kg
Handler
)
session
.
SetEventListener
(
s
.
rpcHandler
)
session
.
SetRQLen
(
conf
.
GettySessionParam
.
PkgRQSize
)
session
.
SetWQLen
(
conf
.
GettySessionParam
.
PkgWQSize
)
session
.
SetReadTimeout
(
conf
.
GettySessionParam
.
tcpReadTimeout
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment