Commit d93f3ba9 authored by son nguyen's avatar son nguyen

Initial commit

parents
Pipeline #391 failed with stages
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="jeromq-0.5.2">
<CLASSES>
<root url="jar://$USER_HOME$/Downloads/jeromq-0.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TestPubSub.iml" filepath="$PROJECT_DIR$/TestPubSub.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="18cdcb3e-00b2-4f1b-af81-21d615068c0b" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="1d41VL5jgMlsVS0FcfgJYys6Lu3" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$USER_HOME$/Downloads/jeromq-0.5.2.jar!/" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2962963" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.psenvpub.Main" />
<module name="TestPubSub" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="18cdcb3e-00b2-4f1b-af81-21d615068c0b" name="Default Changelist" comment="" />
<created>1591669573512</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1591669573512</updated>
<workItem from="1591669575421" duration="2742000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="627" y="196" width="660" height="657" key="#Main" timestamp="1591670112986">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="627" y="196" width="660" height="657" key="#Main/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670112986" />
<state x="555" y="185" width="804" height="679" key="#Project_Structure" timestamp="1591670606222">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="555" y="185" width="804" height="679" key="#Project_Structure/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670606222" />
<state x="418" y="182" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1591669878672">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="418" y="182" key="#com.intellij.execution.impl.EditConfigurationsDialog/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591669878672" />
<state x="596" y="268" width="716" height="514" key="FileChooserDialogImpl" timestamp="1591670756898">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="596" y="268" width="716" height="514" key="FileChooserDialogImpl/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670756898" />
<state width="1878" height="278" key="GridCell.Tab.0.bottom" timestamp="1591673054284">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.bottom/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591673054284" />
<state width="1878" height="278" key="GridCell.Tab.0.center" timestamp="1591673054284">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.center/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591673054284" />
<state width="1878" height="278" key="GridCell.Tab.0.left" timestamp="1591673054284">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.left/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591673054284" />
<state width="1878" height="278" key="GridCell.Tab.0.right" timestamp="1591673054284">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.right/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591673054284" />
<state x="449" y="159" width="1022" height="732" key="SettingsEditor" timestamp="1591670077664">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="449" y="159" width="1022" height="732" key="SettingsEditor/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670077664" />
<state x="287" y="137" width="1339" height="776" key="new project wizard" timestamp="1591670758667">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="287" y="137" width="1339" height="776" key="new project wizard/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670758667" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jeromq-0.5.2" level="project" />
</component>
</module>
\ No newline at end of file
package com.psenvpub;
import org.zeromq.SocketType;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;
import org.zeromq.ZContext;
public class Main {
public static void main(String[] args) {
// write your code here
// Prepare our context and publisher
try (ZContext context = new ZContext()) {
Socket publisher = context.createSocket(SocketType.PUB);
publisher.bind("tcp://*:5563");
while (!Thread.currentThread().isInterrupted()) {
// Write two messages, each with an envelope and content
publisher.sendMore("A");
publisher.send("Dinh Huy");
publisher.sendMore("B");
publisher.send("We would like to see this");
}
}
}
}
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="jeromq-0.5.2">
<CLASSES>
<root url="jar://$USER_HOME$/Downloads/jeromq-0.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectKey">
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TestPubSub2.iml" filepath="$PROJECT_DIR$/TestPubSub2.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<template>
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
</template>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4ad633b9-9b0f-4195-9f53-a16e1ab88ffb" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ProjectId" id="1d43uQaWqF4xaNerSQXJMkPBmuj" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$USER_HOME$/Downloads/jeromq-0.5.2.jar!/" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2962963" />
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.psenvsub.Main" />
<module name="TestPubSub2" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4ad633b9-9b0f-4195-9f53-a16e1ab88ffb" name="Default Changelist" comment="" />
<created>1591670759390</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1591670759390</updated>
<workItem from="1591670762398" duration="992000" />
<workItem from="1591756426124" duration="3578000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="555" y="185" width="804" height="679" key="#Project_Structure" timestamp="1591670820717">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="555" y="185" width="804" height="679" key="#Project_Structure/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670820717" />
<state x="596" y="268" width="716" height="514" key="FileChooserDialogImpl" timestamp="1591670817790">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state x="596" y="268" width="716" height="514" key="FileChooserDialogImpl/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591670817790" />
<state width="1878" height="278" key="GridCell.Tab.0.bottom" timestamp="1591760313883">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.bottom/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591760313883" />
<state width="1878" height="278" key="GridCell.Tab.0.center" timestamp="1591760313883">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.center/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591760313883" />
<state width="1878" height="278" key="GridCell.Tab.0.left" timestamp="1591760313883">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.left/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591760313883" />
<state width="1878" height="278" key="GridCell.Tab.0.right" timestamp="1591760313883">
<screen x="0" y="0" width="1920" height="1048" />
</state>
<state width="1878" height="278" key="GridCell.Tab.0.right/1919.16.1920.1080/0.0.1920.1048@0.0.1920.1048" timestamp="1591760313883" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jeromq-0.5.2" level="project" />
</component>
</module>
\ No newline at end of file
package com.psenvsub;
import org.zeromq.SocketType;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;
import org.zeromq.ZContext;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.nio.ByteBuffer;
public class Main {
public static void main(String[] args) {
// write your code here
// Prepare our context and subscriber
try (ZContext context = new ZContext()) {
Socket subscriber = context.createSocket(SocketType.SUB);
subscriber.connect("tcp://192.168.0.208:5556");
subscriber.subscribe("10000".getBytes(ZMQ.CHARSET));
while (!Thread.currentThread().isInterrupted()) {
// Read envelope with address
byte[] data = new byte[100];
data = subscriber.recv();
// Read message contents
System.out.println(data);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment