sendthread.java

来自「短信网关发送接受平台。」· Java 代码 · 共 67 行

JAVA
67
字号
package orderapp;	/**	 * Title:	 * Description:	 *      发送线程,与submit队列连接	 * Copyright:    Copyright (c) 2002	 * Company:	 * @author	 * @version 1.0	 */import java.io.*;import java.net.*;import utilities.Engine;import xml.getLabel;public class sendThread extends Engine {	public getLabel GetLabel;	public String str;	public sendThread(OutputStream out) {		super("SendManager");		setDaemon(true);		Config.ps=new PrintStream(out);		GetLabel=new getLabel();	}	public void run(){		while(isRunning()){			try{				if(!Config.submit_queue.isEmpty()){					str=(String)Config.submit_queue.pop();					//System.out.println("|"+Config.submit_queue.size+"|mt");					//Config.LogPool.push("Get A  MT:\t"+GetLabel.getString("destination/name",str)+";dest_terminal_id:  "+GetLabel.getString("dest_terminal_id",str)+";Msg_fmt:  "+GetLabel.getString("msg_fmt",str)+";Msg_content:  "+GetLabel.getString("msg_content",str)+";Tp_udhi"+GetLabel.getString("tp_udhi",str));					if (str!=null){						//str=str+"\r\n";						Config.ps.print(str);						System.out.println(str);						Config.incMt();					}				}				//Thread.sleep((1024)/(Config.submit_queue.size+1));				Thread.sleep(1);			}catch(Exception e){				//this.shutdown();				Config.LogPool.push("while the thread: "+e.toString()+" is writing data from socket!" );				//System.out.println("while the thread: "+this.toString()+" is writing data from socket!");			}		}		//shutdown();	}/*	public void shutdown(){		super.shutdown();		try{			Config.ps.close();		}catch(Exception e){}	}	public static void main(String[] args) {		//SendManager sendManager1 = new SendManager();	}*/}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?