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
1f552daa
Commit
1f552daa
authored
Jun 22, 2024
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.5.5
1.連接超時時間默認10秒 2.onClose方法錯誤內容為連接失敗時,不觸發onError方法
parent
02d2c28f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
mylibrary/build.gradle.kts
+1
-1
mylibrary/src/main/java/com/gingersoft/connect/utils/GingerSoftConnect.kt
+1
-1
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketClient.kt
+7
-6
No files found.
mylibrary/build.gradle.kts
View file @
1f552daa
...
...
@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect"
artifactId = "Connect"
version = "1.5.
4
"
version = "1.5.
5
"
// 添加 POM 配置
// pom {
// name.set("GingerSoftConnect")
...
...
mylibrary/src/main/java/com/gingersoft/connect/utils/GingerSoftConnect.kt
View file @
1f552daa
...
...
@@ -10,7 +10,7 @@ class GingerSoftConnect {
fun
connect
(
ip
:
String
,
port
:
Int
,
connectOutTime
:
Int
=
10
,
connectOutTime
:
Int
=
10
000
,
listener
:
SocketStateListener
?
):
MessageBuilder
{
val
uri
=
URI
(
"ws://$ip:$port"
)
...
...
mylibrary/src/main/java/com/gingersoft/connect/utils/MyWebSocketClient.kt
View file @
1f552daa
...
...
@@ -41,13 +41,14 @@ class MyWebSocketClient(
}
override
fun
onClose
(
code
:
Int
,
reason
:
String
?,
remote
:
Boolean
)
{
status
=
if
(
reason
!=
null
&&
reason
.
contains
(
"failed to connect"
)){
onError
(
ConnectException
(
reason
))
3
}
else
{
//
= if(reason!=null && reason.contains("failed to connect")){
//
onError(ConnectException(reason))
//
3
//
} else {
listener
?.
onClose
(
code
,
reason
,
remote
)
2
}
status
=
2
// 2
// }
}
override
fun
onError
(
ex
:
Exception
?)
{
...
...
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