• 大小: 411KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Java
  • 标签: java  

资源简介

课程project,滑动窗口模拟,多线程,共享精神

资源截图

代码片段和文件信息

package p2;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.linkedBlockingQueue;

import javax.swing.JFileChooser;
import javax.swing.Jframe;
import javax.swing.JLabel;
@SuppressWarnings(“serial“)
public class Client extends Jframe {

    TextField windowSize = new TextField(); 
    TextArea ta = new TextArea(); 
    Label label = new Label(“\u7A97\u53E3\u5927\u5C0F“);
    Label label_1 = new Label(“\u4FE1\u606F“);
    Button button_start = new Button(“\u63A5\u6536\u6A21\u5F0F“);
    JLabel label_2 = new JLabel(“\u5206\u6BB5\u5927\u5C0F“);
    TextField datalong = new TextField();
    Button button = new Button(“\u52A0\u5DE5\u5E76\u53D1\u9001“);
    transferm tran = new transferm();
    Button button_1 = new Button(“\u5BFC\u5165\u53D1\u9001\u6570\u636E“);
    TextField output_textField = new TextField();
    Button button_output = new Button(“\u5BFC\u51FA\u6536\u5230\u6570\u636E“);
    TextField zhenField = new TextField();
    Button button_zhenhao = new Button(“\u663E\u793A“);
    
Socket s = null;
    DataOutputStream dos = null;
    DataInputStream dis = null;
    static boolean bConnected = false;
    static boolean bSend = false;
    BlockingQueue queue = new linkedBlockingQueue();
    RSThread rs = new RSThread(); 
    SThread send = new SThread();
    ACKThread ack = new ACKThread();
    
    static long endTimestartTime;
    static int windowsizedatasizecountrevccount;
    static int windowpointer = 0;
    static int ACK=-1SEQ=-1;
    String filePathoutputPath;
    String ackframe=“0“;
    List sendlist = new ArrayList();
    List> List_buffer = new ArrayList>();
    List buffer = new ArrayList();
    static List> windowbuffer = new ArrayList>();
    static List> sendbuffer = new ArrayList>();
    static List Byte_buffer = new ArrayList(); 
    static List timelist = new ArrayList();
    static List Ban = new ArrayList();
    static List> Listinlist = new ArrayList>();
    static List> display = new ArrayL

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         699  2016-06-05 12:14  说明.txt
     文件       63714  2016-06-05 12:02  57130516_p0.jpg
     文件      522240  2016-06-04 22:47  计网project2报告.doc
     文件        7269  2016-05-31 21:39  2.PNG
     目录           0  2016-05-19 19:55  Project_2\
     文件         301  2016-05-19 19:55  Project_2\.classpath
     文件         385  2016-05-19 19:55  Project_2\.project
     目录           0  2016-05-24 18:53  Project_2\.settings\
     文件         598  2016-05-19 19:55  Project_2\.settings\org.eclipse.jdt.core.prefs
     目录           0  2016-05-30 12:56  Project_2\bin\
     目录           0  2016-05-30 12:56  Project_2\bin\p2\
     文件         618  2016-05-30 12:59  Project_2\bin\p2\Client$1.class
     文件         763  2016-05-30 12:59  Project_2\bin\p2\Client$2.class
     文件         716  2016-05-30 12:59  Project_2\bin\p2\Client$3.class
     文件         615  2016-05-30 12:59  Project_2\bin\p2\Client$4.class
     文件         621  2016-05-30 12:59  Project_2\bin\p2\Client$5.class
     文件         646  2016-05-30 12:59  Project_2\bin\p2\Client$6.class
     文件        1844  2016-05-30 12:59  Project_2\bin\p2\Client$ACKThread.class
     文件        2793  2016-05-30 12:59  Project_2\bin\p2\Client$RSThread.class
     文件        1019  2016-05-30 12:59  Project_2\bin\p2\Client$SThread$1.class
     文件        4031  2016-05-30 12:59  Project_2\bin\p2\Client$SThread.class
     文件       14234  2016-05-30 12:59  Project_2\bin\p2\Client.class
     文件         761  2016-05-30 12:56  Project_2\bin\p2\FileChooser.class
     文件        1903  2016-05-30 12:56  Project_2\bin\p2\Make_frame.class
     文件         760  2016-05-30 12:56  Project_2\bin\p2\Server$1.class
     文件         884  2016-05-30 12:56  Project_2\bin\p2\Server$2.class
     文件         791  2016-05-30 12:56  Project_2\bin\p2\Server$3.class
     文件        3270  2016-05-30 12:56  Project_2\bin\p2\Server$ClientThread.class
     文件        1225  2016-05-30 12:56  Project_2\bin\p2\Server$ServerThread.class
     文件        5562  2016-05-30 12:56  Project_2\bin\p2\Server.class
     文件        1764  2016-05-30 12:56  Project_2\bin\p2\transferm.class
............此处省略7个文件信息

评论

共有 条评论