TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Javon Zhang
NA
1
9.8k
How to improve HttpWebRequest's performance ?
Mar 19 2013 3:36 AM
thks for your comein, my question is that:
I use HttpWebRequest to get one URL content with "GET" Method,
and many guys want to get it like me,
I try to get the message first while the URL content change,
but I always slower than the others.
I want to know how to improve HttpWebRequest's performance effectively.
my general code :
int interval = 10;
Thread = null;
void Query(string url)
{
while(true){
thread = new Thread(new ThreadStart(()=>{
try{
HttpWebRequest request = (HttpWebRequest)Webrequet.creaete(url);
....
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response....Stream());
this.ExecuteHtmlHanlder(reader.ReadToEnd());
}catch{...}
}));
thread.IsBackGround = true;
thread.Start();
Thread.Sleep(interval);
}
}
Reply
Answers (
1
)
Congratulation Nitin Bhardwaj
Introduction of an integer in C