[問題] 網路下載分流,公司考試題目

看板Programming作者 (小新)時間14年前 (2011/02/28 14:26), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串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
文章代碼(AID): #1DQq0l0D (Programming)
文章代碼(AID): #1DQq0l0D (Programming)