Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
b0a858bb
E
et
项目概览
guo450212436
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b0a858bb
编写于
6月 15, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TCP据说有连接不上的问题,加几个log方便查错
上级
c7500f18
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
5 deletion
+23
-5
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs
+2
-2
Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs
Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs
+1
-1
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
+19
-2
Unity/Assets/Scripts/Module/Message/Network/TCP/TService.cs
Unity/Assets/Scripts/Module/Message/Network/TCP/TService.cs
+1
-0
未找到文件。
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs
浏览文件 @
b0a858bb
...
...
@@ -8,7 +8,7 @@ namespace ETHotfix
{
public
override
void
Awake
(
NetOuterComponent
self
)
{
self
.
Awake
(
NetworkProtocol
.
K
CP
);
self
.
Awake
(
NetworkProtocol
.
T
CP
);
self
.
MessagePacker
=
new
ProtobufPacker
();
self
.
MessageDispatcher
=
new
OuterMessageDispatcher
();
}
...
...
@@ -19,7 +19,7 @@ namespace ETHotfix
{
public
override
void
Awake
(
NetOuterComponent
self
,
IPEndPoint
ipEndPoint
)
{
self
.
Awake
(
NetworkProtocol
.
K
CP
,
ipEndPoint
);
self
.
Awake
(
NetworkProtocol
.
T
CP
,
ipEndPoint
);
self
.
MessagePacker
=
new
ProtobufPacker
();
self
.
MessageDispatcher
=
new
OuterMessageDispatcher
();
}
...
...
Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs
浏览文件 @
b0a858bb
...
...
@@ -22,7 +22,7 @@
{
public
void
Awake
()
{
this
.
Awake
(
NetworkProtocol
.
K
CP
);
this
.
Awake
(
NetworkProtocol
.
T
CP
);
this
.
MessagePacker
=
new
ProtobufPacker
();
this
.
MessageDispatcher
=
new
ClientDispatcher
();
}
...
...
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
浏览文件 @
b0a858bb
...
...
@@ -12,8 +12,8 @@ namespace ETModel
public
sealed
class
TChannel
:
AChannel
{
private
Socket
socket
;
private
readonly
SocketAsyncEventArgs
innArgs
=
new
SocketAsyncEventArgs
();
private
readonly
SocketAsyncEventArgs
outArgs
=
new
SocketAsyncEventArgs
();
private
SocketAsyncEventArgs
innArgs
=
new
SocketAsyncEventArgs
();
private
SocketAsyncEventArgs
outArgs
=
new
SocketAsyncEventArgs
();
private
readonly
CircularBuffer
recvBuffer
=
new
CircularBuffer
();
private
readonly
CircularBuffer
sendBuffer
=
new
CircularBuffer
();
...
...
@@ -64,6 +64,8 @@ namespace ETModel
this
.
socket
.
Close
();
this
.
innArgs
.
Dispose
();
this
.
outArgs
.
Dispose
();
this
.
innArgs
=
null
;
this
.
outArgs
=
null
;
this
.
socket
=
null
;
}
...
...
@@ -145,10 +147,15 @@ namespace ETModel
private
void
OnConnectComplete
(
object
o
)
{
if
(
this
.
IsDisposed
)
{
throw
new
Exception
(
"TChannel已经被Dispose, 不能发送消息"
);
}
SocketAsyncEventArgs
e
=
(
SocketAsyncEventArgs
)
o
;
UserTokenInfo
userTokenInfo
=
(
UserTokenInfo
)
e
.
UserToken
;
if
(
userTokenInfo
.
InstanceId
!=
this
.
InstanceId
)
{
Log
.
Error
(
$"session disposed!"
);
return
;
}
...
...
@@ -196,10 +203,15 @@ namespace ETModel
private
void
OnRecvComplete
(
object
o
)
{
if
(
this
.
IsDisposed
)
{
throw
new
Exception
(
"TChannel已经被Dispose, 不能发送消息"
);
}
SocketAsyncEventArgs
e
=
(
SocketAsyncEventArgs
)
o
;
UserTokenInfo
userTokenInfo
=
(
UserTokenInfo
)
e
.
UserToken
;
if
(
userTokenInfo
.
InstanceId
!=
this
.
InstanceId
)
{
Log
.
Error
(
$"session disposed!"
);
return
;
}
...
...
@@ -287,10 +299,15 @@ namespace ETModel
private
void
OnSendComplete
(
object
o
)
{
if
(
this
.
IsDisposed
)
{
throw
new
Exception
(
"TChannel已经被Dispose, 不能发送消息"
);
}
SocketAsyncEventArgs
e
=
(
SocketAsyncEventArgs
)
o
;
UserTokenInfo
userTokenInfo
=
(
UserTokenInfo
)
e
.
UserToken
;
if
(
userTokenInfo
.
InstanceId
!=
this
.
InstanceId
)
{
Log
.
Error
(
$"session disposed!"
);
return
;
}
...
...
Unity/Assets/Scripts/Module/Message/Network/TCP/TService.cs
浏览文件 @
b0a858bb
...
...
@@ -75,6 +75,7 @@ namespace ETModel
UserTokenInfo
userTokenInfo
=
(
UserTokenInfo
)
e
.
UserToken
;
if
(
userTokenInfo
.
InstanceId
!=
this
.
InstanceId
)
{
Log
.
Error
(
$"session disposed!"
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录