C
Chris Mullins
I'm running on the Windows CE Emulator with VS.NET 2003. I installed SP1 of
the Compact Framework onto the emulator.
I'm calling web services asychronously from the Compact Framework. There
seems to be a limit of 2 simultanious Asych methods running at once before
calls that I make to the Web Service block inside the Compact Framework.
The exact behavior that I see is:
- call Async method 1 (using the BeginXXX method name)
- call Async method 2 (using the BeginXXX method name)
- call method (sync or async). This call will NOT leave the compact
framework until one of the two Async methods has completed. As soon as
either of the Async methods completes, the call with execute and things will
proceed.
I've tried calling the Sync method from my own (manually created) background
thread with no avail.
The code to duplicate this behavior is:
(WEB Service code)
---------------------------------
<WebMethod()> _
Public Function LongRunningMethod() As String
System.Threading.Thread.Sleep(30 * 1000)
Return "LongRunningMethod"
End Function
<WebMethod()> _
Public Function QuickMethod() As String
Return "QuickMethod"
End Function
Compact Framework Code:
----------------------------------
Private _s As New WebReference.Service1
Private Sub Button1_Click(...) Handles Button1.Click
_s.BeginLongRunningMethod(AddressOf callback, Nothing)
_s.BeginLongRunningMethod(AddressOf callback, Nothing)
Dim r As String = _s.QuickMethod() '*** THIS LINE DOES NOT RUN
Debug.WriteLine(r)
End Sub
Private Sub callback(ByVal ar As IAsyncResult)
Dim s As String = _s.EndLongRunningMethod(ar)
Debug.WriteLine(s)
End Sub
When I put a breakpoint on the "QuickMethod" in the Web Service, I don't hit
the breakpoint until one of the two long-running web service calls has
completed. This tells me the problem is on the Compact Framework side, not
on the Web Service side.
the Compact Framework onto the emulator.
I'm calling web services asychronously from the Compact Framework. There
seems to be a limit of 2 simultanious Asych methods running at once before
calls that I make to the Web Service block inside the Compact Framework.
The exact behavior that I see is:
- call Async method 1 (using the BeginXXX method name)
- call Async method 2 (using the BeginXXX method name)
- call method (sync or async). This call will NOT leave the compact
framework until one of the two Async methods has completed. As soon as
either of the Async methods completes, the call with execute and things will
proceed.
I've tried calling the Sync method from my own (manually created) background
thread with no avail.
The code to duplicate this behavior is:
(WEB Service code)
---------------------------------
<WebMethod()> _
Public Function LongRunningMethod() As String
System.Threading.Thread.Sleep(30 * 1000)
Return "LongRunningMethod"
End Function
<WebMethod()> _
Public Function QuickMethod() As String
Return "QuickMethod"
End Function
Compact Framework Code:
----------------------------------
Private _s As New WebReference.Service1
Private Sub Button1_Click(...) Handles Button1.Click
_s.BeginLongRunningMethod(AddressOf callback, Nothing)
_s.BeginLongRunningMethod(AddressOf callback, Nothing)
Dim r As String = _s.QuickMethod() '*** THIS LINE DOES NOT RUN
Debug.WriteLine(r)
End Sub
Private Sub callback(ByVal ar As IAsyncResult)
Dim s As String = _s.EndLongRunningMethod(ar)
Debug.WriteLine(s)
End Sub
When I put a breakpoint on the "QuickMethod" in the Web Service, I don't hit
the breakpoint until one of the two long-running web service calls has
completed. This tells me the problem is on the Compact Framework side, not
on the Web Service side.