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