473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Application Hangs When Closing After Successful HTTP Connection

I'm able to successfully retrieve a webpage from a web server with a
VB.NET desktop application using (HttpWebRequest/HttpWebResponse), but
when I click the Close button on the application, both it and the
VB.NET debugger hang. I pretty sure I'm closing all the connections
and streams before when this function ends. Any ideas?

If the function below is run before I close the application, then the
application will hang. I have tried the function from 3 different
projects, and only on one of them does the application close without
hanging itself and the debugger.
Public Sub CheckForUpdate()
' objects for writing and reading bytes to streams
Dim objRequest As System.Net.HttpWebRequest
Dim objResponse As System.Net.HttpWebResponse
Dim reader As System.IO.StreamReader
Dim webPage As String
Dim objStream As System.IO.Stream

Try
objRequest =
CType(System.Net.WebRequest.Create("http://192.168.1.102/TBOnline/FileInfo.aspx?version="
& FileVersionInfo.GetVersionInfo("TB.exe").FileVersi on),
System.Net.HttpWebRequest)

objResponse =
CType(objRequest.GetResponse,System.Net.HttpWebRes ponse)
objStream = objResponse.GetResponseStream
reader = New System.IO.StreamReader(objStream)
webPage = reader.ReadToEnd

Catch ex As Exception
MsgBox(ex.Message)
Finally
If Not reader Is Nothing Then reader.Close()
If Not objResponse Is Nothing Then objResponse.Close()
If Not objStream Is Nothing Then objStream.Close()
objResponse.Close()
End Try

End Sub
Nov 21 '05 #1
0 1074

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Colin Steadman | last post by:
Does anyone have a suggestion how I could debug this problem: 1. Data is collected from database and displayed in a form. 2. User updates data and submits it. 3. Submitted data is compared with...
0
by: Mike Knight | last post by:
(I've also posted this problem on microsoft.public.excel.programming) I have a MS Access 2003 Database named "AS400 Fields.mdb". This database contains links to tables on an AS400. In MS...
1
by: Davey | last post by:
I have an MS Access 2003 database that uses a SQL Server 2000 database as it's back-end. The database runs well most of the time but if the users dont use the database for a period of time (approx...
2
by: Marty | last post by:
I can navigate all over my site when there is no DB involved, but as soon as I hit the database, the page hangs and times out. Since the page does not change, the trace debugging does not tell me...
13
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). ...
5
by: Loane Sharp | last post by:
Hi there I've got a hang of a problem ... I'm running the .NET framework (2.0.40903), SQL Server 2000 and SQL Express 2005 on Windows XP Pro on a pretty good and new IBM Thinkpad X41. Some...
0
by: jeff.dyke | last post by:
I am using ftplib in some code that does exactly what you would expect. It ftp's files. Its running inside a service running on windows xp and windows 2003 servers, approximately 20 installations...
0
by: Arno Stienen | last post by:
Perhaps I should be a bit more specific. When using this code to connect to a remote XML-RPC server (C++, xmlrpc++0.7 library): import xmlrpclib server =...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.