|
发现一个问题:异步请求时常常发生阻塞
POST请求似乎更容易发生阻塞的问题.
不知道是什么原因?
public static void GetDepth(string symbol)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = $"https://api.********.com/market/depth?symbol={symbol}&type=step0&depth=20",
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
ResultType = ResultType.String,
Timeout = 1000,
ReadWriteTimeout = 1000
};
http.BeginInvokeGetHtml(item, new ResultHandler(Market.Depth_arrived));
|
|