码迷,mamicode.com
首页 > 其他好文 > 详细

phoenixframe平台连接socket服务器,并接收返回值的示例

时间:2015-08-15 12:09:58      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

package org.phoenix.cases.webservice;

import java.util.LinkedList;

import org.phoenix.action.WebElementActionProxy;
import org.phoenix.model.CaseLogBean;
import org.phoenix.model.UnitLogBean;
import org.phoenix.utils.NetTelnet;

/**
 * phoenixframe平台连接socket服务器,并接收返回值的示例
 * @author mengfeiyang
 *
 */
public class TestSocket extends WebElementActionProxy{
	private static String caseName = "";
	@Override
	public LinkedList<UnitLogBean> run(CaseLogBean arg0) {
		init(caseName,arg0);
		
		NetTelnet n = new NetTelnet("10.161.88.64",8889);
		System.out.println(n.sendCommand("test","Password:"));//向服务器发送test指令,并接收结尾为Password:关键字的字符
		n.disconnect();
		
		return getUnitLog(); 
	}

}


phoenixframe平台连接socket服务器,并接收返回值的示例

标签:

原文地址:http://my.oschina.net/u/2391658/blog/492874

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!