generated from mingliqiye/lib-tem
Compare commits
No commits in common. "master" and "Auto-Releases-1.0.4-d3596154bc" have entirely different histories.
master
...
Auto-Relea
@ -1,3 +1,4 @@
|
||||
|
||||
import java.security.MessageDigest
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
@ -37,8 +38,8 @@ dependencies {
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
implementation("org.jetbrains:annotations:24.0.0")
|
||||
annotationProcessor("org.jetbrains:annotations:24.0.0")
|
||||
implementation("com.mingliqiye:network-endpoint:1.0.4")
|
||||
implementation("com.mingliqiye:string-utils:1.0.4")
|
||||
implementation("com.mingliqiye:network-endpoint:1.0.2")
|
||||
implementation("com.mingliqiye:string-utilts:1.0.4")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
27
build.yaml
Normal file
27
build.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
name: Gitea Actions Build
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-dev
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: https://git.mingliqiye.com/Actions/checkout@v4
|
||||
|
||||
- name: build-test
|
||||
run: |
|
||||
source gradle.properties
|
||||
gradle
|
||||
gradle build-jar
|
||||
|
||||
- name: Releases
|
||||
run: |
|
||||
source gradle.properties
|
||||
SHA=${{gitea.sha}}
|
||||
curl -o- https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases/raw/branch/master/install.sh | bash
|
||||
FILENAME="${GROUPSID}-${VERSIONS}.jar"
|
||||
java -jar com.mingliqiye.gitea.releases.jar -s "${{gitea.server_url}}" -o "${{gitea.repository_owner}}" -r ${{gitea.event.repository.name}} -t "${{gitea.token}}" -ti "Auto releases ${{gitea.sha}} ${VERSIONS}" -b "# Auto releases wtih ${{gitea.event.head_commit.message}} - [${{gitea.sha}}](${{gitea.event.head_commit.url}})" -tn "Auto-Releases-${VERSIONS}-${SHA:0:10}" -a "build/libs"
|
||||
|
@ -1,5 +1,5 @@
|
||||
GROUPSID=com.mingliqiye
|
||||
ARTIFACTID=socket-utilts
|
||||
VERSIONS=1.0.7
|
||||
VERSIONS=1.0.4
|
||||
MAINCLASS=com.mingliqiye.Main
|
||||
JDKVERSIONS=1.8
|
||||
|
@ -6,7 +6,7 @@ import java.net.ServerSocket;
|
||||
|
||||
public class DefTcpServerImplementation extends TcpServerImplementation {
|
||||
|
||||
public boolean connect(TcpSocketClient client, String id) {
|
||||
boolean connect(TcpSocketClient client, String id) {
|
||||
System.out.println(
|
||||
StringUtil.format(
|
||||
"客户端 {} ID={} 连接成功",
|
||||
@ -17,7 +17,7 @@ public class DefTcpServerImplementation extends TcpServerImplementation {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void disconnect(TcpSocketClient client, String id) {
|
||||
void disconnect(TcpSocketClient client, String id) {
|
||||
System.out.println(
|
||||
StringUtil.format(
|
||||
"客户端 {} ID={} 断开连接",
|
||||
@ -27,7 +27,7 @@ public class DefTcpServerImplementation extends TcpServerImplementation {
|
||||
);
|
||||
}
|
||||
|
||||
public void reception(
|
||||
void reception(
|
||||
TcpSocketClient client,
|
||||
BufferBytesEntity bufferBytesEntity
|
||||
) {
|
||||
@ -46,7 +46,7 @@ public class DefTcpServerImplementation extends TcpServerImplementation {
|
||||
);
|
||||
}
|
||||
|
||||
public void started(ServerSocket serverSocket) {
|
||||
void started(ServerSocket serverSocket) {
|
||||
System.out.println(
|
||||
StringUtil.format(
|
||||
"服务器启动 监听 {}",
|
||||
@ -57,7 +57,7 @@ public class DefTcpServerImplementation extends TcpServerImplementation {
|
||||
);
|
||||
}
|
||||
|
||||
public void closed() {
|
||||
void closed() {
|
||||
System.out.println("服务器已经关闭");
|
||||
}
|
||||
}
|
||||
|
@ -14,21 +14,21 @@ public abstract class TcpServerImplementation {
|
||||
* @param id 客户端ID
|
||||
* @return 是否允许连接
|
||||
*/
|
||||
public abstract boolean connect(TcpSocketClient client, String id);
|
||||
abstract boolean connect(TcpSocketClient client, String id);
|
||||
|
||||
/**
|
||||
* 断开连接回调函数
|
||||
* @param client 客户端
|
||||
* @param id 客户端ID
|
||||
*/
|
||||
public abstract void disconnect(TcpSocketClient client, String id);
|
||||
abstract void disconnect(TcpSocketClient client, String id);
|
||||
|
||||
public abstract void reception(
|
||||
abstract void reception(
|
||||
TcpSocketClient client,
|
||||
BufferBytesEntity bufferBytesEntity
|
||||
);
|
||||
|
||||
public abstract void started(ServerSocket serverSocket);
|
||||
abstract void started(ServerSocket serverSocket);
|
||||
|
||||
public abstract void closed();
|
||||
abstract void closed();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class TcpSocketServer extends Thread implements AutoCloseable {
|
||||
);
|
||||
if (!tcpServerImplementation.connect(tcpSocketClient, uuid)) {
|
||||
tcpSocketClient.close();
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
clientMap.put(uuid, tcpSocketClient);
|
||||
tcpSocketClient.start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user