Socket ????÷????
???????????? ???????[ 2015/1/20 14:28:36 ] ????????Socket java
????/**
???? * ??????????????????????????????????ó??????????????????
?????????????????????????
???? */
????package com.xushouwei;
????//??????????
????import java.net.*;
????import java.io.*;
????public class TServer
????{
???? public static void main(String[] args)
???? {
????//????ServerSocket??
????ServerSocket s=null;
????//????Socket??
????Socket s1;
????//???巢???????
????String sendString="??????????????...";
???? //?????????????????
????int s1lenth=sendString.length();
????//????OutputStream??
????OutputStream s1out;
????//????DataOutputStream??
????DataOutputStream dos;
????//???1314??????????
???? try
???? {
????//????ServerSocket??????????
????s=new ServerSocket(1314);
????} catch (Exception e)
???? {
????e.printStackTrace();
????}
???? //??????м????????????????????
???? while(true)
???? {
???? try
???? {
????//??????????????????
???? s1=s.accept();
????//?????socket?????????????????
????s1out=s1.getOutputStream();
???? dos=new DataOutputStream(s1out);
????//?????????
???? dos.writeUTF(sendString);
????//???????????????????Socket?????
????dos.close();
???? s1out.close();
????s1.close();
????} catch (Exception e)
????{
????e.printStackTrace();
????}
???? }
???? }
????}
????2.????????
????TCP/IP ??????????ó???????? Java ?????????? Socket ??????????????Socket ???????????????????????????????????????????????????
????Socket(InetAddress address??int port)
????Socket(InetAddress address??int port??Boolean stream)
????Socket(String host??int port)
????Socket(String host??int port?? InetAddress localAddr??int localPort)
???????У?address??host ?? port ??????????????? IP ??????????????????stream ?????? Socket ???????????? Socket??localAddr ?? localPort ????????????????????
???????????????????????????????????????????????????????????????
????/**
???? * ????????????????????????????????????????????????????????????????????????????
???? */
????package com.xushouwei;
????//??????????
????import java.net.*;
????import java.io.*;
????public class TClint
????{
???? public static void main(String[] args)
???? {
???? //????Socket??
????Socket s1;
????//????InputStream??
????InputStream s1In;
????//????DataInputStream??
????DataInputStream dis;
????try
????{
????//????1314??????
????s1=new Socket("127.0.0.1"??1314);
????//???socket?????????????????ж??????
????s1In=s1.getInputStream();
????dis=new DataInputStream(s1In);
????String st=new String(dis.readUTF());
????System.out.println(st);
????//?????????????????????socket????
????dis.close();
????s1In.close();
????s1.close();
????} catch (Exception e)
????{
????e.printStackTrace();
????}
????}
????}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
C# Socket?????????????Java?е?Socket???÷?????LoadRunner??дsocket???????????????????-SOCKETЭ???????????Java Socket???Java Socket??????Java???WebSocket??Tomcat???Java??socket????UDPЭ??Linux??Socket???C++????TCP??UDP??socket????????дJ(rèn)ava NIO Socket???????????????????socket?????java???????Linux?????socket??????LoadRunner??Э?????Winsocket??C/S??ó???Socket?????????Щ?????LoadRunner?????windows socketЭ??
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????