讓我們想象有一臺服務器,當接收到一個汽車模型的請求時,查詢所有已知的汽車經銷商尋找最便宜的汽車經銷商,並用價格迴應(使用任何協議)。此操作需要一段時間。 在一個偶然的禁止請求/響應服務器模式,我做 request = "audi a8" // prepare a request and one line after have the response
response = server.find
我想在服務器類的HandleConnectionAsync方法中保持打開的tcp連接。它將從客戶端接收持續更新。 我希望能收到讀者付諸dataFromClient更新,而不必把我的代碼在我的服務器實現類之中。 所以: static void Main(string[] args)
{
Server s = new Server();
s.start();
//get