Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GingerSoftLANInterconnection
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
王宇航
GingerSoftLANInterconnection
Commits
27d4fdec
Commit
27d4fdec
authored
Nov 02, 2024
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.8.0
增加一些日誌
parent
870e8c77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
mylibrary/build.gradle.kts
+1
-1
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketServer.kt
+5
-1
No files found.
mylibrary/build.gradle.kts
View file @
27d4fdec
...
@@ -55,7 +55,7 @@ afterEvaluate {
...
@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect"
groupId = "com.gingersoft.connect"
artifactId = "Connect"
artifactId = "Connect"
version = "1.
7.9
"
version = "1.
8.0
"
// 添加 POM 配置
// 添加 POM 配置
// pom {
// pom {
// name.set("GingerSoftConnect")
// name.set("GingerSoftConnect")
...
...
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketServer.kt
View file @
27d4fdec
...
@@ -32,14 +32,18 @@ class MyWebSocketServer(address: InetSocketAddress) :
...
@@ -32,14 +32,18 @@ class MyWebSocketServer(address: InetSocketAddress) :
// 有KDS主動獲取食品、沽清信息接口
// 有KDS主動獲取食品、沽清信息接口
// RicePOS收到KDS要獲取食品的消息後,發送本地食品信息過去
// RicePOS收到KDS要獲取食品的消息後,發送本地食品信息過去
message
?.
let
{
message
?.
let
{
Log
.
e
(
TAG
,
"創建協程"
)
val
msg
=
GsonUtils
.
GsonToBean
(
message
,
MessageBean
::
class
.
java
)
val
msg
=
GsonUtils
.
GsonToBean
(
message
,
MessageBean
::
class
.
java
)
// 创建一个协程作用域
// 创建一个协程作用域
val
scope
=
CoroutineScope
(
Dispatchers
.
IO
)
val
scope
=
CoroutineScope
(
Dispatchers
.
IO
)
// 在协程作用域中异步处理消息
// 在协程作用域中异步处理消息
scope
.
launch
{
scope
.
launch
{
Log
.
e
(
TAG
,
"開始處理消息"
)
MsgParser
.
process
(
msg
)
?.
let
{
MsgParser
.
process
(
msg
)
?.
let
{
val
gsonString
=
GsonUtils
.
GsonString
(
it
)
Log
.
e
(
TAG
,
"處理結果:$gsonString"
)
// 接受到消息並處理後,將結果返回回去
// 接受到消息並處理後,將結果返回回去
conn
?.
send
(
GsonUtils
.
GsonString
(
it
)
)
conn
?.
send
(
gsonString
)
}
}
}
}
}
}
...
...
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