Socket
文章平均质量分 60
gundumw100
这个作者很懒,什么都没留下…
展开
-
socket基本连接
服务器端:public class ServerSocketConnection extends Thread{ private Socket client; ServerSocketConnection(Socket client){ this.client=client; } public void run(){ try { BufferedReader in =原创 2017-04-10 17:15:39 · 332 阅读 · 0 评论 -
socket发送数据
String date = request.getParameter("date");List l =this.getBillService().getPayData(date);StringBuffer sb=new StringBuffer();for(int i=0;i<l.size();i++){WtPepBillpay w =(WtPepBillpay)l.get(i);原创 2017-04-10 17:22:40 · 682 阅读 · 0 评论 -
socket发送和接受数据
import java.net.*;import java.io.*;public class MyConnection2{ public static void main(String[] args) throws Exception { Socket socket = new Socket("www.ptpress.com.cn", 80)原创 2017-04-10 17:40:38 · 373 阅读 · 0 评论 -
java-Socket接受中文乱码的解决
服务器发送一条数据如:BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));PrintWriter out = new PrintWriter(client.getOutputStream());out.println("没有查到该数据。");//向客户端发送o原创 2017-04-10 17:41:09 · 14348 阅读 · 1 评论 -
J2EE工具类:ClientSocketUtil.java&ServerSocketConnection.java
客户端:import java.io.*;import java.net.InetAddress;import java.net.Socket;public class ClientSocketUtil { protected static Socket server;// private String url="";// private int port=9原创 2017-04-10 18:02:28 · 1806 阅读 · 0 评论