Larry Brister
asked on
WIndows Service Timeout and HttpWebRequest/Response
I have a Windows service that starts a series of threads on start
The threads each launch a HttpWebRequest in which the HttpWebResponse needs to never close.
However...
This is my Header on the request.
What can I change so the Response never closes?
The threads each launch a HttpWebRequest in which the HttpWebResponse needs to never close.
However...
This is my Header on the request.
What can I change so the Response never closes?
sendWebRequest.SendChunked = True
sendWebRequest.Method = "POST"
sendWebRequest.ContentType = "text/plain"
sendWebRequest.KeepAlive = True
sendWebRequest.UserAgent = "CometTest"
sendWebRequest.ServicePoint.ConnectionLimit = 20
sendWebRequest.Timeout = 43200
sendWebRequest.ReadWriteTimeout = System.Threading.Timeout.Infinite
Has it started closing? How long does it stay open?
ASKER
CodeCruiser
Not counting startup...looks like the 43200
12 hours
Then the service stops?
Anyway I can just restart?
Not counting startup...looks like the 43200
12 hours
Then the service stops?
Anyway I can just restart?
Service stops or the webrequest stops? Yes you can restart.
ASKER
CodeCruiser
I'm not experienced at Web Services at all.
So...should I make this two EE questions?
How do I restart the Windows service from inside itself?
How do I restart the Web Request?
I'm not experienced at Web Services at all.
So...should I make this two EE questions?
How do I restart the Windows service from inside itself?
How do I restart the Web Request?
I am confused as to what is stopping after 12 hours. Is the webrequest terminating or is the service stopping?
ASKER
CodeCruiser
The web service is. And I don't understand why
The only thing with a timer on it is the Web Request
The web service is. And I don't understand why
The only thing with a timer on it is the Web Request
>The web service is
You mean Windows service right?
>The only thing with a timer on it is the Web Request
And what is the duration of that timer?
You mean Windows service right?
>The only thing with a timer on it is the Web Request
And what is the duration of that timer?
ASKER
CodeCruiser
I think I'm totally messing this conversation up
The Windows Service is stopping at the 43200 seconds point
I don't have an actual timer control at all
At no point am I telling the Windows Service to stop
I have no error message in the log
It simply stops at the 43200 point
The only place I have that is in the HttpWebRequest.
The HttpWebRequest Timeout is set in a sub
Blah..blah...blah...
Dim sendWebRequest As HttpWebRequest = CType(WebRequest.Create(st Url), HttpWebRequest)
Then this
'Attach unique id so Response stream attaches to THIS request
sendWebRequest.Headers.Add ("ID: " + guid)
'Web request Header
sendWebRequest.SendChunked = True
sendWebRequest.Method = "POST"
sendWebRequest.ContentType = "text/plain"
sendWebRequest.KeepAlive = True
sendWebRequest.UserAgent = "CometTest"
sendWebRequest.ServicePoin t.Connecti onLimit = 1000
sendWebRequest.Timeout = 43200
sendWebRequest.ReadWriteTi meout = System.Threading.Timeout.I nfinite
I think I'm totally messing this conversation up
The Windows Service is stopping at the 43200 seconds point
I don't have an actual timer control at all
At no point am I telling the Windows Service to stop
I have no error message in the log
It simply stops at the 43200 point
The only place I have that is in the HttpWebRequest.
The HttpWebRequest Timeout is set in a sub
Blah..blah...blah...
Dim sendWebRequest As HttpWebRequest = CType(WebRequest.Create(st
Then this
'Attach unique id so Response stream attaches to THIS request
sendWebRequest.Headers.Add
'Web request Header
sendWebRequest.SendChunked
sendWebRequest.Method = "POST"
sendWebRequest.ContentType
sendWebRequest.KeepAlive = True
sendWebRequest.UserAgent = "CometTest"
sendWebRequest.ServicePoin
sendWebRequest.Timeout = 43200
sendWebRequest.ReadWriteTi
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks