From c0dcc080ba0fa2165a52b5c21bf601894c9f8f9a Mon Sep 17 00:00:00 2001 From: "Mr.Huang" <1123033157@qq.com> Date: Thu, 23 Nov 2017 22:21:38 +0800 Subject: [PATCH] update --- README.md | 22 +++++++++---------- build.gradle | 4 +--- gradle.properties | 2 +- .../java/com/dream/socket/DreamUDPSocket.java | 3 +-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c829dfc..f43aa64 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,20 @@ Socket连接客户端,精简版本的Netty或者Mina ### 使用方式 - Gradle: - compile 'com.github.spacetimeme:dream-socket:1.1.1' +Gradle + + compile 'com.github.spacetimeme:dream-socket:2.0.0' - Maven: +Maven + com.github.spacetimeme dream-socket - 1.1.1 + 2.0.0 + +[TCP Server](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/TCPServer.java) +[TCP使用方式](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/TCPClient.java) - - -[服务端](https://github.com/spacetimeme/IMService) - -[TCP使用方式](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/Client.java) - -[UCP使用方式](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/UDPClient.java) \ No newline at end of file +[UDP Server](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/UDPServer.java) +[UDP使用方式](https://github.com/spacetimeme/DreamSocket/blob/master/src/test/java/com/dream/socket/UDPClient.java) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 85682af..85a70fd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,10 @@ apply plugin: 'java' apply plugin: 'maven' -//apply from: 'gradle-mvn-push.gradle' +apply from: 'gradle-mvn-push.gradle' repositories { mavenCentral() } dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile "com.google.protobuf:protobuf-java:3.3.1" } diff --git a/gradle.properties b/gradle.properties index f003789..e2ef6da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -POM_VERSION_NAME=1.1.1 +POM_VERSION_NAME=2.0.0 POM_GROUP=com.github.spacetimeme POM_ARTIFACT_ID=dream-socket POM_PACKAGING=jar diff --git a/src/main/java/com/dream/socket/DreamUDPSocket.java b/src/main/java/com/dream/socket/DreamUDPSocket.java index d9c9ecd..c3362ae 100644 --- a/src/main/java/com/dream/socket/DreamUDPSocket.java +++ b/src/main/java/com/dream/socket/DreamUDPSocket.java @@ -94,9 +94,8 @@ public boolean isConnected() { return false; } - public boolean send(String host, int port, Message data) { + public boolean send(SocketAddress address, Message data) { if (mSocketSendRunnable != null) { - SocketAddress address = new InetSocketAddress(host, port); data.mAddress = address; mSocketSendRunnable.send(data); return true;