当前位置: 首页 > news >正文

三型布局的网站做网站要求什么条件

三型布局的网站,做网站要求什么条件,网络应用服务管理,团员注册网站我正在编写一个代码#xff0c;需要每秒从Android移动设备向台式计算机(linux服务器)发送数据。由于数据经常发送#xff0c;通过Http命中无法实现(因为会消耗时间)#xff0c;所以Tcp通信似乎是更好的选择#xff0c;因为android手机的数据可以通过此套接字编程快速发送。…我正在编写一个代码需要每秒从Android移动设备向台式计算机(linux服务器)发送数据。由于数据经常发送通过Http命中无法实现(因为会消耗时间)所以Tcp通信似乎是更好的选择因为android手机的数据可以通过此套接字编程快速发送。 客户端的Android手机上的代码是Android和Linux服务器之间的TCP连接import java.io.IOException;import java.io.OutputStream;import java.io.PrintWriter;import java.net.InetAddress;import java.net.Socket;import java.net.UnknownHostException;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class GetWebPage extends Activity {//Handler h;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);final EditText eText (EditText) findViewById(R.id.address);final TextView tView (TextView) findViewById(R.id.pagetext);final Button button (Button) findViewById(R.id.ButtonGo);button.setOnClickListener(new Button.OnClickListener() {public void onClick(View v) {try {Log.v(Tcp,Clicked the button);InetAddress serveraddressInetAddress.getByName(67.23.14.156);Log.v(Tcp, Got the InetAddress);Socket s new Socket(serveraddress,4447);Log.v(Tcp,Got the Socket address);OutputStream out s.getOutputStream();PrintWriter output new PrintWriter(out);output.println(Hello Android!);out.close();} catch (UnknownHostException e) {tView.setText(e.toString());Log.v(Tcp,e.toString());} catch (IOException e) {tView.setText(e.toString());Log.v(Tcp,e.toString());}catch (Exception e) {tView.setText(e.toString());}}});}}服务器端代码import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.ServerSocket;import java.net.Socket;public class ListenIncomingTcpConnection {public static void main(String[] args) {ServerSocket serverSocketnull;Socket clientnull;try {System.out.println(Creating the server object...);serverSocket new ServerSocket(4447);System.out.println(Waiting for the connection...);} catch (IOException e1) {System.out.println(e1);}while (true) {try {client serverSocket.accept();System.out.println(Reading the content...);} catch (IOException e1) {System.out.println(e1);e1.printStackTrace();}try {BufferedReader in new BufferedReader(new InputStreamReader(client.getInputStream()));String str in.readLine();System.out.println(Reading the content.....);} catch(Exception e) {System.out.println(e);} finally {try{client.close();}catch(Exception e){System.out.println(e);}}}//while}//PSVM}清单文件的代码是packagecom.spce android:versionCode1 android:versionName1.0我已经执行了服务器端的代码在linux机器上通过putty上的“java”命令。它在此行执行并停止“client serverSocket.accept();” 当我执行的Android手机客户端它说单击该按钮 得到InetAddress是否 java.net.SocketException异常没有到主机的路由我不能够发现的这种情况的原因没有路由到主机。请帮忙解决问题。2011-03-15Khushboo
http://www.pierceye.com/news/479848/

相关文章:

  • 网站用户界面设计国内网站建设最好公司
  • 运城做网站费用高吗高端模板建站
  • 凡客诚品网站设计合肥网红打卡地
  • 淘宝网站代理怎么做的广西送变电建设公司铁塔厂网站
  • 自媒体网站开发网站的推广方式包括
  • 教育做的比较好的网站有哪些网站的建设及维护
  • dw设计做网站案例建设网站杭州
  • 做网站认证对网站有什么好处广西网站建设开发团队
  • 建一个网站需要哪些知识无锡大型互联网公司
  • 餐饮公司 网站建设做网站一年大概的盈利
  • 做金融怎么进基金公司网站免费行情软件网站游戏
  • 网站推广解释创立一个网站要多少钱
  • 绍兴专业网站建设公司大型网站建设哪家好
  • 天河网站设计响应式视频网站模板
  • 网站制作老了手机网站模板开发
  • 哪家网站建设比较好海拉尔建网站
  • 丹东网站推广海南行指专业网站开发
  • 网站如何调用手机淘宝做淘宝客中国企业网站查询
  • 淄博建设工程学校官方网站专门做商标的网站有哪些
  • 私人免费网站怎么下载企业网站设计方案
  • 做阿里巴巴网站找谁互联网推广公司
  • 网站如何做微信支付宝支付宝支付网页传奇发布网
  • 网站建设语录谷歌浏览器官网下载
  • 互动营销网站免费学高中课程的软件
  • 沈阳网站建设活动方案公司网站建设攻略
  • 建网站 方法喜来健cms系统
  • 甘肃 网站备案关于网站开发费用的入账
  • 南昌建网站的公司个人博客模板网站
  • 银川建设局网站丹江口网站制作
  • 做化工的 有那些网站自动的东莞网站制作公司