[問題] 網路分流,公司考題

看板CSSE (電腦科學及軟體工程)作者 (小新)時間13年前 (2011/02/28 14:28), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
4. Suppose server S want to download real time video from one of existing media servers A, B, C, D. However the server S still doesn't know which media server is available and can provide the highest speed transfer. Please write a simple code to make the server S chooses the fastest server using below function: a. int get_speed(ServerID); This function is used to get the transfer speed from Server[ServerID] to server S on HTTP protocol. The return value of this function is integer value. For example: get_speed(A) return 15, it means the transfer speed is 15 Kbps. b. bool connect(server); This function is to check the availability of the media server using RMTP (Real Time Message Protocol). This function will return true if the media server have the video source that can be streamed by server S. For example: connect(A) return true, it means server S can stream video from server A. Hint: get_speed(serverID) function only check the transfer speed of the media server using normal HTTP. It doesn't guarantee the media server is available. Example: Media Server A may provide the highest transfer speed, however there is no video source available in media server A. So in this case, server B may connect to other server 這是小弟在網路上看到的題目 是一間公司考新人用的 不知是否有人能解得出來? 小弟...完全不知如何下手 還請高人指點 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.240.89.139

03/06 10:36, , 1F
maximumBy (compare `on` get_speed) . filter connect
03/06 10:36, 1F
文章代碼(AID): #1DQq2bUW (CSSE)
文章代碼(AID): #1DQq2bUW (CSSE)