I am making a connection to a webservice and the whole process takes about 15 seconds
While this time, the application is stuck (I'm programm for a device), so I have now changed to async webrequest which is working great!
Now I can Push the "Abort"-Button and it is asking if I want to stop the whole process. Before it asked only after the whole process
My problem is that I dont know how to end the async webrequest.
This is the async call:
Dim asyncCallback As New AsyncCallback(AddressOf FinishSum)
srvcon.BeginCheckRegistration(username, password, 1, 2, 3, asyncCallback, Nothing)
While a = "" ' Here I am waiting for the result, while that I can press on Abort which sets Abbruch to true
If abbruch = True Then
and this the result
Public Sub FinishSum(ByVal IAsyncResult As IAsyncResult)
a = srvcon.EndCheckRegistration(IAsyncResult)
But now if I exit it (goto gh), the webrequest is still running in another thread and returns after 15 seconds a value...
How can I stop it?