I walk through the following code and when I reach the last line, which is
highlighted in yellow from the debugger, I step forward and nothing happens.
The yellow highlighted block goes away and the while loop is no longer
executed. The code is on a second thread. After stepping forward, focus
returns to the application or main form. There are no errors or exceptions.
While True
Try
If networkStream.CanWrite And networkStream.CanRead Then
networkStream = tcpClient.GetStream()
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0,
tcpClient.ReceiveBufferSize)
I did this change to see exactly which part of the above line was causing
the problem. The debugger does the same thing on the last line here.
Dim mysize As Integer =
CInt(tcpClient.ReceiveBufferSize)
networkStream.Read(bytes, 0, mysize)
Any idea how I can trouble shoot this? Why does the debugger just suddenly
go away?
Thanks,
Brett 4 1124
Brett,
Remember that NetworkStream.Read() is a blocking call. When
NetworkStream.Read() blocks, the debugger cannot continue because it's
waiting for the Read() call to complete.
Are you sure that data is read at all?
Regards,
-Adam.
Brett wrote: I walk through the following code and when I reach the last line, which is highlighted in yellow from the debugger, I step forward and nothing happens. The yellow highlighted block goes away and the while loop is no longer executed. The code is on a second thread. After stepping forward, focus returns to the application or main form. There are no errors or exceptions.
While True Try
If networkStream.CanWrite And networkStream.CanRead Then
networkStream = tcpClient.GetStream()
Dim bytes(tcpClient.ReceiveBufferSize) As Byte networkStream.Read(bytes, 0, tcpClient.ReceiveBufferSize)
I did this change to see exactly which part of the above line was causing the problem. The debugger does the same thing on the last line here.
Dim mysize As Integer = CInt(tcpClient.ReceiveBufferSize) networkStream.Read(bytes, 0, mysize)
Any idea how I can trouble shoot this? Why does the debugger just suddenly go away?
Thanks, Brett
I'm not sure the data is read. Shouldn't it be read if the debugger comes
back? How do I tell?
Why would it start doing this all of the sudden? I do get data back from
the Listener but that was before this started happening. How can I be sure
the problem is on the client or listener side?
Thanks,
Brett
"Adam Goossens" <ad***********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Brett,
Remember that NetworkStream.Read() is a blocking call. When NetworkStream.Read() blocks, the debugger cannot continue because it's waiting for the Read() call to complete.
Are you sure that data is read at all?
Regards, -Adam.
Brett wrote: I walk through the following code and when I reach the last line, which is highlighted in yellow from the debugger, I step forward and nothing happens. The yellow highlighted block goes away and the while loop is no longer executed. The code is on a second thread. After stepping forward, focus returns to the application or main form. There are no errors or exceptions.
While True Try
If networkStream.CanWrite And networkStream.CanRead Then
networkStream = tcpClient.GetStream()
Dim bytes(tcpClient.ReceiveBufferSize) As Byte networkStream.Read(bytes, 0, tcpClient.ReceiveBufferSize)
I did this change to see exactly which part of the above line was causing the problem. The debugger does the same thing on the last line here.
Dim mysize As Integer = CInt(tcpClient.ReceiveBufferSize) networkStream.Read(bytes, 0, mysize)
Any idea how I can trouble shoot this? Why does the debugger just suddenly go away?
Thanks, Brett
Hi Brett,
It's probably a good bet that if the debugger can't advance past that
line, then no data is coming in. If you're expecting data to be coming
in at a constant rate, it sounds like a problem with the server.
If the debugger steps to the next line, one of two things has happened:
1) Data was read without problem, or,
2) The Read() call has returned 0 (zero) indicating that all data has
been read and the remote host has shut down the connection.
Since neither of those two is happening, it is fair enough to assume
that your listener is waiting for data to be received, but none is being
sent.
You might want to try stepping through your server code as well. If you
step through both of them at once you might be able to find the point
where something isn't quite right.
Let me know how you go.
Regards,
-Adam.
Brett wrote: I'm not sure the data is read. Shouldn't it be read if the debugger comes back? How do I tell?
Why would it start doing this all of the sudden? I do get data back from the Listener but that was before this started happening. How can I be sure the problem is on the client or listener side?
Thanks, Brett
Hi Brett, How do I debug two applications at the same time? Two instances of VS.NET?
Spot on. Run your server in one instance, your client in another, set
some breakpoints and let them go.
Has this problem always occurred, or is it a recent thing?
Regards,
-Adam. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff |
last post by:
Use the MS Script Editor included free with MS Office 2002 and above,
for debugging Internet Explorer (IE).
This subject is of great interest to many JS developers, as there is no
obvious, low...
|
by: zerro |
last post by:
Hello,
I try to understand heap overflows (under Linux), but can not understand
one
thing with freeing memory allocated with malloc(). Here it comes:
I have a program called 1.c:
main() {...
|
by: Keith K |
last post by:
Having developed with VB since 1992, I am now VERY
interested in C#. I've written several applications with
C# and I do enjoy the language.
What C# Needs:
There are a few things that I do...
|
by: Jason Huang |
last post by:
Hi,
Would someone explain the following coding more detail for me? What's the
( ) for?
CurrentText = (TextBox)e.Item.Cells.Controls;
Thanks.
Jason
|
by: Terry Olsen |
last post by:
While running my application, either in or out of the debugger, after a
while the message box pops up that says "MyApp.vshost.exe has encountered a
problem and needs to close." What does the...
|
by: Doug |
last post by:
I'm having problems w/ the VS2005 debugger with C#. It blows past any
breakpoints in even the simplest "Hello World" console application. I can't
do any step-by-step debugging. I've provided the...
|
by: codergem |
last post by:
Helo friends
Could any of you please help me out with this problem.
To me this program of heap sort seems logically perfect but still the
output of this is not coming right,
I dont want to follow...
|
by: xiao |
last post by:
It always dumped when I tried to run it... But it compiles OK. What I
want to do is to do a test:
Read information from a .dat file and then write it to another file.
The original DAT file is...
|
by: Yee.Chuang |
last post by:
When I began to learn C, My teacher told me that pointer is the most
difficult part of C, it makes me afraid of it. After finishing C
program class, I found that all the code I wrote in C contains...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |