Larry Brister
asked on
Server vs PC and Windows Service
I have a Windows Service built in VB.Net Visual Studio 2010
What it does is
Reads a series of phone numbers
For each # starts a different thread
each thread does a HttpWebRequest POST Chunked data
Each POST gets the response and keeps the response stream open indefinitely
While the stream is open it sends the (chunked) data to SQL Server via a Web Service
On any PC WinXP SP1 and greater it runs perfectly
On any server the threads seem to "replicate" the data in the push through the Web Service.
I have the runn and the install for any CPU.
You can see in the screen print below that I have it set to
Active (Any CPU)
I also tried "Any Platform"
Any suggestions?
What it does is
Reads a series of phone numbers
For each # starts a different thread
each thread does a HttpWebRequest POST Chunked data
Each POST gets the response and keeps the response stream open indefinitely
While the stream is open it sends the (chunked) data to SQL Server via a Web Service
On any PC WinXP SP1 and greater it runs perfectly
On any server the threads seem to "replicate" the data in the push through the Web Service.
I have the runn and the install for any CPU.
You can see in the screen print below that I have it set to
Active (Any CPU)
I also tried "Any Platform"
Any suggestions?
ASKER
CodeCruiser
That's correct.
Just on the start up
My code has an If Else that if I get no response on a particular thread...it launches a new thread, and kills the current one without ever going near the WCF
That's correct.
Just on the start up
My code has an If Else that if I get no response on a particular thread...it launches a new thread, and kills the current one without ever going near the WCF
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
CodeCruiser,
That would seem correct...
But my threads in their "Launch" to the HttpWebrequest are on a timer.
The vendor only allows 7 "requestStarts" at a time.
Over the last month I've found it takes a max of 1/2 second per, so I have a sleep in between of 1 full second for each thread starting
Not sure if I just replied correctly to your post
That would seem correct...
But my threads in their "Launch" to the HttpWebrequest are on a timer.
The vendor only allows 7 "requestStarts" at a time.
Over the last month I've found it takes a max of 1/2 second per, so I have a sleep in between of 1 full second for each thread starting
Not sure if I just replied correctly to your post
It could be that the thread is sleeping when you check it. Can you show the code that checks the thread?
ASKER
CodeCruiser,
I need to get back to the dev machine which will be later today.
I'm stuck in a never ending soul killing meeting right now
I need to get back to the dev machine which will be later today.
I'm stuck in a never ending soul killing meeting right now
ok :-)
ASKER
Code Cruiser...
You asked for the code for the whole process...or just the thread being kicked off?
Inside a While datatablerows.count > 0
I have this
If Not sendRow Is Nothing And sendRow.Length > 20 Then
'Declare and start individual thread for each (phonelist) loop
Dim phoneWorkerThread As New Thread(AddressOf startPhoneMonitoring)
phoneWorkerThread.Name = "Thread " + CStr(threadCounter) + " | [" + dataRowString + "]"
phoneWorkerThread.IsBackgr ound = True
phoneWorkerThread.Start(ph oneWorkerT hread.Name .ToString + "|" + sendRow)
End If
then some logic that removes the datarow just sent from the datatable at row(0)
Then my "sleep" line.
I set the delay variable in the top of my class. Right now its 1.5 seconds
But I've tried everything up to many seconds (7-8) with the same problem.
System.Threading.Thread.Sl eep(reques tDelay)
End While
You asked for the code for the whole process...or just the thread being kicked off?
Inside a While datatablerows.count > 0
I have this
If Not sendRow Is Nothing And sendRow.Length > 20 Then
'Declare and start individual thread for each (phonelist) loop
Dim phoneWorkerThread As New Thread(AddressOf startPhoneMonitoring)
phoneWorkerThread.Name = "Thread " + CStr(threadCounter) + " | [" + dataRowString + "]"
phoneWorkerThread.IsBackgr
phoneWorkerThread.Start(ph
End If
then some logic that removes the datarow just sent from the datatable at row(0)
Then my "sleep" line.
I set the delay variable in the top of my class. Right now its 1.5 seconds
But I've tried everything up to many seconds (7-8) with the same problem.
System.Threading.Thread.Sl
End While
ASKER
Finally got back to this and was able to track it down.
Moved things into more of a sequential and less of a concurrent process
Moved things into more of a sequential and less of a concurrent process
You mean the same data is being inserted twice?