RTX Two-time development integration

Source: Internet
Author: User

There are many ports on the 1,RTX server side, and the two-time program interacts with these open ports. Method of opening a port in the RTX Service Manager, the default HTTP service is not enabled. you need to enable the HTTP ports manually as follows:

If you open the RTX server without HTTP-enabled port 8012, you will get an error: Java.net.socket.ConnectException:connection refused

2, the use of Java httpclient way to do information interaction.

Import Java.io.bufferedreader;import Java.io.inputstreamreader;import Java.net.httpurlconnection;import Java.net.url;import Java.net.urlencoder;public class Sendrtxmessage {/** * RTX send Message reminder * @param receivers String receive Person (multiple recipients separated by commas) * @param title string Message title * @param MSG String Message contents * @param type String 0: Normal message 1: Emergency message * @pa Ram Delaytime String Display dwell time (MS) 0: Permanent stop (closed when user closes) * @return int 0: Operation succeeded non 0: operation unsuccessful */public int sendrtxnotify (String Receivers,string title,string msg,string type,string delaytime) throws exception{int iret=-1; String rtxhost = commconstant.rtx_host; StringBuffer strURL = new StringBuffer ("/http" + Rtxhost + ": 8012/sendnotify.cgi");//?msg=hello&receiver=admin "; try{strurl.append ("? msg="). Append (Urlencoder.encode (msg, "gb2312"). Append ("&receiver="). Append ( Urlencoder.encode (Receivers, "gb2312")). Append ("&title="). Append (Urlencoder.encode (title, "gb2312")); Java.net.URL url = new URL (strurl.tostring ()); HttpURLConnection HttpconNection = (httpurlconnection) url.openconnection ();   BufferedReader reader = new BufferedReader (New InputStreamReader (Httpconnection.getinputstream ())); while ((S=reader.readline ())!=null) {result + = s;} if (Result.indexof ("Operation succeeded") >-1) IRet = 0;}    catch (Exception e) {System.out.println ("system error" +e); return iRet;}}

3,windows Lower port occupancy see the following methods:

Command: NETSTAT-AON|FINDSTR [port number];tasklist|findstr [PID]

  

RTX Two-time development integration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.