Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
7959107f
Commit
7959107f
authored
Aug 27, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置
parent
a26c1a50
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
31 deletions
+26
-31
common/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
+23
-28
config/src/main/resources/config/application-test.yml
+3
-3
No files found.
common/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
View file @
7959107f
...
...
@@ -77,23 +77,18 @@ public class WsReadHandler extends SimpleChannelInboundHandler<TextWebSocketFram
}
/**
* 检测到异常
*
* @param ctx
* @param cause
* @throws Exception
*/
@Override
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
{
log
.
info
(
"检测到异常exceptionCaught"
,
cause
);
//排除当客户端意外关闭的情况,不是发送指定指令通知服务器退出,就会产生此错误。
if
(
ctx
.
channel
().
isActive
())
{
String
userIdByChannel
=
mangerChannelService
.
getInfoByChannel
(
ctx
);
log
.
error
(
"uid:"
+
userIdByChannel
+
",ws异常,channelId:"
+
ctx
.
channel
().
id
().
asLongText
(),
cause
);
}
}
// /**
// * 检测到异常
// *
// * @param ctx
// * @param cause
// * @throws Exception
// */
// @Override
// public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
// String userIdByChannel = mangerChannelService.getInfoByChannel(ctx);
// log.info("uid:" + userIdByChannel + ",ws异常,channelId:" + ctx.channel().id().asLongText(), cause);
// }
@Override
public
void
handlerAdded
(
ChannelHandlerContext
ctx
)
{
...
...
@@ -102,17 +97,17 @@ public class WsReadHandler extends SimpleChannelInboundHandler<TextWebSocketFram
}
/**
* 客户端不活跃
*
* @param ctx
* @throws Exception
*/
@Override
public
void
channelInactive
(
ChannelHandlerContext
ctx
)
{
String
userIdByChannel
=
mangerChannelService
.
getInfoByChannel
(
ctx
);
log
.
info
(
"uid:"
+
userIdByChannel
+
","
+
"channelInactive"
+
",channelId:"
+
ctx
.
channel
().
id
().
asLongText
());
}
//
/**
//
* 客户端不活跃
//
*
//
* @param ctx
//
* @throws Exception
//
*/
//
@Override
//
public void channelInactive(ChannelHandlerContext ctx) {
//
String userIdByChannel = mangerChannelService.getInfoByChannel(ctx);
//
log.info("uid:" + userIdByChannel + "," + "channelInactive" + ",channelId:" + ctx.channel().id().asLongText());
//
}
/**
* 移除时触发, 不活跃的情况下会移除,会再次触发该事件
...
...
config/src/main/resources/config/application-test.yml
View file @
7959107f
...
...
@@ -2,7 +2,7 @@ spring-boot-plus:
# 是否启用ansi控制台输出有颜色的字体,local环境建议开启,服务器环境设置为false
enable-ansi
:
false
# 当前环境服务IP地址
server-ip
:
1
72.31.32.11
1
server-ip
:
1
27.0.0.
1
# 文件上传下载配置
upload-path
:
/opt/upload/
# AOP配置
...
...
@@ -16,14 +16,14 @@ spring-boot-plus:
spring
:
datasource
:
url
:
jdbc:mysql://1
72.31.32.11
1:3306/wecloud_im?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
url
:
jdbc:mysql://1
27.0.0.
1:3306/wecloud_im?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
username
:
web
password
:
axT8knPN5hAP
# Redis配置
redis
:
database
:
0
host
:
1
72.31.32.11
1
host
:
1
27.0.0.
1
password
:
JH86uc53r8Ca
port
:
6379
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment