作者ami9897 (小新)
看板Programming
标题[问题] 网路下载分流,公司考试题目
时间Mon Feb 28 14:26:53 2011
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