欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
TCP接收端
package com.cari.sys.biz;
 
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.UnknownHostException;
public class SendGpsTask {
 private String path; // 發(fā)送的地址
 private String tel; // 終端號碼
 private Double[] xx; // 經(jīng)度
 private Double[] yy; // 緯度
 private String[] time; // 時(shí)間
 private String[] vv;  //速度
 public SendGpsTask() {
 }
 public SendGpsTask(String path, String tel, Double[] xx, Double[] yy,
   String[] time,String[] vv) {
  this.path = path;
  this.tel = tel;
  this.xx = xx;
  this.yy = yy;
  this.time = time;
 }
 public static void sendToGIS(String path,int port,String tel, Double[] xx,
   Double[] yy, String[] time,String[] vv) {

  OutputStream outputStream;
  Socket socket=null;
  try {
   InetAddress address = InetAddress.getByName(path);
   //socket = new Socket(path,10003);
    socket = new Socket();
    System.out.println("前置機IP:"+path+",端口號:"+port);
    socket.connect(new InetSocketAddress(address,port), 30000);
   
    outputStream = socket.getOutputStream();
   
   //與接收的流要相同
   ObjectOutputStream objStream = new ObjectOutputStream(outputStream);
   
   //將之前設置的好的對象傳入給服務(wù)器
      String info =  getMessage(tel, xx, yy, time,vv);
   System.out.println("寫(xiě)入數據:"+info);
   objStream.writeObject(info);  
   objStream.flush();
   objStream.close();
   outputStream.close();
   
  }catch(ConnectException e){
   e.printStackTrace();
   for (int i = 0; i < time.length; i++) {
    System.out.println("信息轉發(fā)失敗"+tel+" {X:"+xx[i]+",Y:"+yy[i]+",TT:"+time[i]+",VV:"+vv[i]+"}");
   } 
  } catch (UnknownHostException e) {
   e.printStackTrace();
   System.out.println("UnKnown host:"+path);
  }catch (InterruptedIOException e) {
   e.printStackTrace();
   System.out.println("沒(méi)有讀取數據,時(shí)間超時(shí)");
  } catch (IOException e) {
   e.printStackTrace();
   System.out.println("連接失敗");
  } finally{
   if(socket!=null){
    try {
     socket.close();
     socket=null;
    } catch (IOException e) {
     e.printStackTrace();
    }
   }
  } 
 }
 public static String getMessage(String phone, Double[] longitude,
   Double[] latitude, String[] tt,String[] vv) {
  StringBuffer stringBuffer = new StringBuffer();
       
  stringBuffer.append(phone);
  stringBuffer.append(":");
  int index = longitude.length;
  for (int i = 0; i < index; i++) {
   stringBuffer.append(longitude[i]);
   stringBuffer.append("-");
   stringBuffer.append(latitude[i]);
   stringBuffer.append("-");
   stringBuffer.append(tt[i]);
   stringBuffer.append("-");
   stringBuffer.append(vv[i]);
   
   if (i != index - 1) {
    stringBuffer.append(",");
   }
  }
  return stringBuffer.toString();
 }
 
 public String getPath() {
  return path;
 }
 public void setPath(String path) {
  this.path = path;
 }
 public String getTel() {
  return tel;
 }
 public void setTel(String tel) {
  this.tel = tel;
 }
 public Double[] getXx() {
  return xx;
 }
 public void setXx(Double[] xx) {
  this.xx = xx;
 }
 public Double[] getYy() {
  return yy;
 }
 public void setYy(Double[] yy) {
  this.yy = yy;
 }
 public String[] getTime() {
  return time;
 }
 public void setTime(String[] time) {
  this.time = time;
 }
 public String[] getVv() {
  return vv;
 }
 public void setVv(String[] vv) {
  this.vv = vv;
 }
}
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
JAVA版微信支付V3-完全版
Baidu云盤(pán)API接口的使用使用說(shuō)明
漏洞 木馬 cmdjsp.jsp
StringBuffer類(lèi)的替換功能
byte數組轉int類(lèi)型,不足位數補0問(wèn)題的解決
java: utf-8轉unicode
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久