Skip to content

Commit

Permalink
feat: mdtp add examples module
Browse files Browse the repository at this point in the history
Signed-off-by: wei <[email protected]>
  • Loading branch information
instpe committed Sep 22, 2024
1 parent 964e1f9 commit ba02442
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions mdtp-example/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mdtp-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>mdtp-example</artifactId>

<dependencies>
<dependency>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mdtp-client</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mdtp-server</artifactId>
<version>${version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.protocol.mdtp.examples;

import io.github.protocol.mdtp.client.MdtpClient;
import io.github.protocol.mdtp.client.MdtpClientConfig;

public class MdtpClientExample {

public static void main(String[] args) {
MdtpClientConfig mdtpClientConfig = new MdtpClientConfig().host("127.0.0.1").port(30001);
new MdtpClient(mdtpClientConfig);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.protocol.mdtp.examples;

import io.github.protocol.mdtp.server.MdtpServer;
import io.github.protocol.mdtp.server.MdtpServerConfig;

public class MdtpServerExample {
public static void main(String[] args) throws Exception {
MdtpServerConfig mdtpServerConfig = new MdtpServerConfig().host("127.0.0.1").port(8080);
MdtpServer mdtpServer = new MdtpServer(mdtpServerConfig);
mdtpServer.start();
}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<modules>
<module>mdtp-client</module>
<module>mdtp-server</module>
<module>mdtp-example</module>
</modules>

<properties>
Expand Down

0 comments on commit ba02442

Please sign in to comment.