Truyen file qua mang

  • Published on
    14-Apr-2018

  • View
    221

  • Download
    0

Embed Size (px)

Transcript

  • 7/30/2019 Truyen file qua mang

    1/3

    Truyen file qua mang

    Bao Cao e Tai TruyenFile Qua Mang

    1. Giao thc s dung trong chng trnh

    Chng trnh truyen file qua mang nay c viet bang ngon

    ng Java, s dung giao thc TCP e truyen file. Giao thcTCP la giao thc trao oi thong tin co ket noi, trong Java

    e cai at giao thc TCP ta dung lp Socket va

    ServerSocket. Trong o, lp Socket dung e ket noi mot

    may tnh en mot may tnh khac. Lp ServerSocket dung

    e tao o cam may Server e cac may tnh khac ket noi

    en. Giao thc TCP c xem la giao thc truyen d lieu

    co o tin cay va an toan cao, khong mat mat d lieu vaang c s dung rong rai tren the gii.

    2. To chc chng trnh

    Chng trnh nay gom 5 lp : Goi.class, MyCell.class,

    transferfile.class, Server.class, Client.class. Trong o, lp Client

    va lp transferfile la hai lp thc hien cac nhiem vu chnh

    (gi file va nhan file) cua chng trnh . Lp Client la giao

    dien chnh cua chng trnh, c cai at may con. Lp

    transferfile va lp Server e lang nghe cac ket noi cua

    may con en may chu, c cai at ben may chu. Lp

    Goi la mot goi d lieu c dung e truyen cac d lieu

    t may chu en may con va ngc lai.

    3. Cach s dung chng trnh

    Ben may Client ta cai at lp Client, ben may Server ta cai

    at lp Server. Dch cac lp nay bang trnh dch JDK. Sau

    o, ben may Server se bat au lang nghe cac ket noi

    t cac may Client, ben may Client se hien ra giao dien va

    ngi dung se thao tac theo ch dan cua chng trnh.

    Minh hoa bang hnh anh:

    Nhom thc hien Nhom 9

    1

  • 7/30/2019 Truyen file qua mang

    2/3

    Truyen file qua mang

    1. Hnh anh Server ang lang nghe

    2. Hnh anh giao dien cua chng trnh

    e bat au ket noi gia Client va Server ta nhap so hieu

    cong mac nh la 1234 va a ch cua may Server vao

    giao dien cua chng trnh , ta co the upload file len th muc

    Nhom thc hien Nhom 9

    2

  • 7/30/2019 Truyen file qua mang

    3/3

    Truyen file qua mang

    goc cua may Server bang cach chon mot hoac nhieu file

    t bang chon file ben Client va bam vao nut upload, hoac

    ta co the click oi vao bang chon file e gi file. Sau o ta

    co the download file t th muc goc cua may Server

    xuong may Client. Chng trnh nay c thiet ke ch khi

    nao ngi dung upload file len may Server th mi co the

    download file ve may Client c ,ch can thc hien viec

    upload file ben Client mot lan th se download file c.

    4. Cac van e a giai quyet c

    Chng trnh nay a giai quyet c van e truyen d

    lieu qua mang. Chng trnh nay co the upload va download

    c cac d lieu co dung lng ln en vai chuc MB ma

    khong b mat hoac h hong d lieu. Ben canh o chng

    trnh con co cac thong bao cho biet d lieu a ton tai

    va yeu cau co chuyen d lieu bang cach ghi e len hay

    khong. Tuy nhien, v thi gian co han nen chng trnh cha

    c hoan chnh, rat mong y kien ong gop cua thay

    co va cac ban e chng trnh c hoan thien hn.

    5. Thanh vien thc hien1. Nguyen Trung Ky

    2. Nguyen Thanh T

    3. Nguyen Th Hoai Thanh

    4. Tran c Giang

    5. Nguyen Thanh Man

    Nhom thc hien Nhom 9

    3