Git Product home page Git Product logo

python's People

Contributors

readera193 avatar

Stargazers

 avatar

Watchers

 avatar

python's Issues

feat[Instant Chatting]: 新增結束通訊

調整項目:

  1. BUFSIZE增加,80=>150
  2. REGISTRAT_PORT更改,648=>5060
  3. 新增常數CODING,儲存編碼方式,目前編碼為UTF-8
  4. 儲存servers時,去除'role'欄位,減少空間浪費
  5. 當新server註冊時不再顯示所有server,只顯示新註冊的server
  6. client端選擇server時,開始的index調整,0=>1
  7. server與client的收發訊息皆改成一個thread+一個while
  8. 當client端輸入"oo"結束通訊

191230

  1. simple_xmlrpc
  2. xmlrpc_caesar

fix[Instant Chatting]: server list過多時,超過BUFSIZE丟出異常

問題:

  1. server list過多時,client端丟出異常

原因:

  1. 要求server list時,registrar一次send所有server
    但BUFSIZE只有150,server超過三個容易溢出

調整項目:

  1. servers=>serverList
  2. getServers=>getServerList
  3. 改用迴圈一個一個傳server資料,用recv製造等待效果,client傳給registrar的"continue"並無實際效果,未來可以更改傳送格式
  4. 減少多餘的BUFSIZE,150=>80

20191125

  1. 上傳ch07_asyncio_upper
  2. 上傳3_Client_asyncio
  3. 改用asyncio
  4. 上傳 delayTest.py

20191119作業

MergeSort.py

  1. 只需要send陣列,原left/right功能用[:]切片運算取代
  2. multiprocessing.log_to_stderr(logging.ERROR)取代原logging
  3. import time,計算mergeSort花費時間

作業:Bidirectional Over-and-Out

問題:
client端送出oo後,server端沒有except處理ConnectionResetError

調整項目:

  1. import logging
  2. 新增except ConnectionResetError

refactor:[Chat_room] 重構serverThread

更改SOCKS結構,sock=>username改為username=>sock
新增常數ERROR_MSG,儲存錯誤指令說明訊息
為傳送ERROR_MSGBUFSIZE增加為150
serverThread新增屬性username,儲存使用者名稱,簡化程式碼
提出設定使用者名稱的程式碼,寫成函式setUsername(),讓流程更清楚
BUG修復:原本可以設定已存在的使用者名稱造成錯誤,在setUsername()增加判斷函式
提出/quit的程式碼,未來"使用者非使用指令離開/意外斷線時"可呼叫
新增:當使用者連線成功時提醒使用者設定username

20191104程式

上傳

  1. ch06_tls_version
  2. ch06_tls_sock
  3. localhost.pem
  4. ca.crt
  5. tls_four_short_integer

fix[Chat_room]:QUIT指令帶參數BUG

問題:
QUIT指令後面有參數時,會導致client的sendThread進入無窮迴圈

原因:
沒有檢查QUIT參數數量

調整項目:
指令為QUIT且不帶參數才執行userQuit()

fix[Chat_room]: 修復使用者^C退出BUG

問題:
使用者^C退出時,server丟出ConnectionResetError,顯示"遠端主機已強制關閉一個現存的連線"

原因:
使用者強制關閉時,sock會斷開連接

調整項目:
使用try-except,收到ConnectionResetError時呼叫userQuit()

feat[Instant Chatting]:server unregister

調整項目:

  1. 'role'欄位更改為'command',內容可能是'register'/'unregister'/'client'
  2. 新增'unregister'功能
  3. 新增功能:client端發送"oo"或^c結束連線

style[Instant Chatting]: 去除finally、else

調整項目:

  1. REGISTRAR_PORT調整,5060=>8136
  2. 重新命名threadRecv=>recvThread、threadSend=>sendThread
  3. command client語意不明確,更改為ask_server_list
  4. 去除finally、else,讓程式碼更容易閱讀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.