-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ repositories { | |
|
||
dependencies { | ||
api(libs.java.websocket) | ||
api(project(":server")) | ||
api(project(":common")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
...src/test/kotlin/test/kwsify/TestClient.kt → api/src/test/kotlin/kws/TestClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
/* | ||
* Copyright © 2024 RTAkland | ||
* Copyright © 2025 RTAkland | ||
* Author: RTAkland | ||
* Date: 2024/11/30 | ||
* Date: 2025/1/5 | ||
*/ | ||
|
||
|
||
package test.kwsify | ||
package kws | ||
|
||
import cn.rtast.kwsify.Kwsify | ||
import cn.rtast.kwsify.Subscriber | ||
import cn.rtast.kwsify.entity.OutboundMessageBytesPacket | ||
|
||
|
||
fun main() { | ||
val wsify = Kwsify("ws://127.0.0.1:8080") | ||
wsify.subscribe("test", true, object : Subscriber { | ||
|
||
override fun onMessage(channel: String, payload: ByteArray, packet: OutboundMessageBytesPacket) { | ||
override fun onMessage(channel: String, rawPacket: ByteArray, packet: OutboundMessageBytesPacket) { | ||
println(String(packet.body)) | ||
} | ||
|
||
override fun onClosed(channel: String) { | ||
println("closed") | ||
wsify.reconnect() | ||
} | ||
|
||
override fun onOpen(channel: String) { | ||
|
||
} | ||
}) | ||
Thread.sleep(1000L) | ||
while (true) { | ||
wsify.publish("test", "114514") | ||
Thread.sleep(1000) | ||
} | ||
} | ||
} |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ain/kotlin/cn/rtast/kwsify/util/Binary.kt → ...ain/kotlin/cn/rtast/kwsify/util/Binary.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Copyright © 2025 RTAkland | ||
* Author: RTAkland | ||
* Date: 2025/1/3 | ||
* Date: 2025/1/5 | ||
*/ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
server/src/main/kotlin/cn/rtast/kwsify/entity/ConnectionState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
server/src/test/kotlin/test/TestServer.kt → server/src/test/kotlin/kws/TestServer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
/* | ||
* Copyright © 2024 RTAkland | ||
* Copyright © 2025 RTAkland | ||
* Author: RTAkland | ||
* Date: 2024/11/30 | ||
* Date: 2025/1/5 | ||
*/ | ||
|
||
|
||
package test | ||
package kws | ||
|
||
import cn.rtast.kwsify.util.KWsifyServer | ||
|
||
fun main() { | ||
KWsifyServer(8080).start() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ rootProject.name = "kwsify" | |
|
||
include(":api") | ||
include(":server") | ||
include("common") |