Hi All,
This is my first time using this interface, so I am sure I am just missing
something stupid. When my Http Handler gets called, the Begin runs and the
delegate runs, but the EndProcessReque st never runs and the page hangs
forever. Any idea why?
Public Class MyAsyncWebHandl er
Implements IHttpAsyncHandl er
Implements IReadOnlySessio nState
Public Sub ProcessRequest( ByVal context As HttpContext) Implements
IHttpHandler.Pr ocessRequest
' not called
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements
IHttpHandler.Is Reusable
Get
Return True
End Get
End Property
' Define the private Async method Delegate
Private Delegate Sub AsyncProcessReq uest(ByVal context As HttpContext)
Public Function BeginProcessReq uest( _
ByVal context As HttpContext, ByVal cb As AsyncCallback,
ByVal state As Object) _
As IAsyncResult Implements
IHttpAsyncHandl er.BeginProcess Request
Dim dlgt As New AsyncProcessReq uest(AddressOf DoMyStuff)
Return dlgt.BeginInvok e(context, Nothing, Nothing)
End Function
Public Sub EndProcessReque st(ByVal ar As IAsyncResult) Implements
IHttpAsyncHandl er.EndProcessRe quest
Dim dlgt As AsyncProcessReq uest = DirectCast(Dire ctCast(ar,
AsyncResult).As yncDelegate, AsyncProcessReq uest)
dlgt.EndInvoke( ar)
End Sub
Public Sub DoMyStuff(ByVal context As HttpContext)
Threading.Threa d.Sleep(3000)
End Sub
End Class
Thanks,
--
Steve Wright, MCSD, MCDBA, MCSE
Microsoft Architect
MSI - Omaha, NE
This is my first time using this interface, so I am sure I am just missing
something stupid. When my Http Handler gets called, the Begin runs and the
delegate runs, but the EndProcessReque st never runs and the page hangs
forever. Any idea why?
Public Class MyAsyncWebHandl er
Implements IHttpAsyncHandl er
Implements IReadOnlySessio nState
Public Sub ProcessRequest( ByVal context As HttpContext) Implements
IHttpHandler.Pr ocessRequest
' not called
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements
IHttpHandler.Is Reusable
Get
Return True
End Get
End Property
' Define the private Async method Delegate
Private Delegate Sub AsyncProcessReq uest(ByVal context As HttpContext)
Public Function BeginProcessReq uest( _
ByVal context As HttpContext, ByVal cb As AsyncCallback,
ByVal state As Object) _
As IAsyncResult Implements
IHttpAsyncHandl er.BeginProcess Request
Dim dlgt As New AsyncProcessReq uest(AddressOf DoMyStuff)
Return dlgt.BeginInvok e(context, Nothing, Nothing)
End Function
Public Sub EndProcessReque st(ByVal ar As IAsyncResult) Implements
IHttpAsyncHandl er.EndProcessRe quest
Dim dlgt As AsyncProcessReq uest = DirectCast(Dire ctCast(ar,
AsyncResult).As yncDelegate, AsyncProcessReq uest)
dlgt.EndInvoke( ar)
End Sub
Public Sub DoMyStuff(ByVal context As HttpContext)
Threading.Threa d.Sleep(3000)
End Sub
End Class
Thanks,
--
Steve Wright, MCSD, MCDBA, MCSE
Microsoft Architect
MSI - Omaha, NE
Comment