473,385 Members | 1,470 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,385 software developers and data experts.

System.NullReferenceException , why?

I just started to learn C# (my background is in C++), and right now I
study the sockets, TCP/IP etc... so, I found a usefull source code at:
http://www.codeguru.com/Csharp/Cshar...cle.php/c8781/.
But there is a scenarion that throw a strange exception. So, the client
is connected to the server, I send a message from client to server and
viceversa and than I stop the server from the 'x' button from the right-up
corner; in that moment the client throw System.NullReferenceException:

An unhandled exception of type 'System.NullReferenceException' occurred
in system.dll
Additional information: Object reference not set to an instance of an
object.

the cursor is placed here:
000000a0 0F B6 F0 movzx esi,al

and the Call Stack stopped here:
system.dll!System.Net.Sockets.OverlappedAsyncResul t.CompletionPortCallback(uint
errorCode = 64, uint numBytes = 0, System.Threading.NativeOverlapped*
nativeOverlapped = 1750608) + 0xa0 bytes

There is a solution?

Thank you in advance.

..:Alex:.
Feb 24 '06 #1
3 3621
Hi,

What escenrio?

What is the code you were executing when this exception is thrown

That exception happen when you are access a variable that is null
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alex J." <al*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I just started to learn C# (my background is in C++), and right now I
study the sockets, TCP/IP etc... so, I found a usefull source code at:
http://www.codeguru.com/Csharp/Cshar...cle.php/c8781/.
But there is a scenarion that throw a strange exception. So, the
client is connected to the server, I send a message from client to server
and viceversa and than I stop the server from the 'x' button from the
right-up corner; in that moment the client throw
System.NullReferenceException:

An unhandled exception of type 'System.NullReferenceException' occurred
in system.dll
Additional information: Object reference not set to an instance of an
object.

the cursor is placed here:
000000a0 0F B6 F0 movzx esi,al

and the Call Stack stopped here:

system.dll!System.Net.Sockets.OverlappedAsyncResul t.CompletionPortCallback(uint
errorCode = 64, uint numBytes = 0, System.Threading.NativeOverlapped*
nativeOverlapped = 1750608) + 0xa0 bytes

There is a solution?

Thank you in advance.

.:Alex:.

Feb 24 '06 #2
Hi,

I don't know if you took a look at the source code from this url:
http://www.codeguru.com/Csharp/Cshar...cle.php/c8781/
Try to make 2 projects from these files a client and a server. 'Start
Listen' the server and then connect the client to the server. Kill the
server from procesess (task manager).
You will se how the client throw the exeption in subject:
System.NullReferenceException

Let me know if you understand me.

Thank you for your attention.

..:Alex:.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OS**************@tk2msftngp13.phx.gbl...
Hi,

What escenrio?

What is the code you were executing when this exception is thrown

That exception happen when you are access a variable that is null
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alex J." <al*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I just started to learn C# (my background is in C++), and right now I
study the sockets, TCP/IP etc... so, I found a usefull source code at:
http://www.codeguru.com/Csharp/Cshar...cle.php/c8781/.
But there is a scenarion that throw a strange exception. So, the
client is connected to the server, I send a message from client to server
and viceversa and than I stop the server from the 'x' button from the
right-up corner; in that moment the client throw
System.NullReferenceException:

An unhandled exception of type 'System.NullReferenceException'
occurred in system.dll
Additional information: Object reference not set to an instance of an
object.

the cursor is placed here:
000000a0 0F B6 F0 movzx esi,al

and the Call Stack stopped here:

system.dll!System.Net.Sockets.OverlappedAsyncResul t.CompletionPortCallback(uint
errorCode = 64, uint numBytes = 0, System.Threading.NativeOverlapped*
nativeOverlapped = 1750608) + 0xa0 bytes

There is a solution?

Thank you in advance.

.:Alex:.


Feb 24 '06 #3
> That exception happen when you are access a variable that is null

ok, d'accord :), but where exactly it happens in that code?
Do you have a ideea?
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OS**************@tk2msftngp13.phx.gbl...
Hi,

What escenrio?

What is the code you were executing when this exception is thrown

That exception happen when you are access a variable that is null
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alex J." <al*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I just started to learn C# (my background is in C++), and right now I
study the sockets, TCP/IP etc... so, I found a usefull source code at:
http://www.codeguru.com/Csharp/Cshar...cle.php/c8781/.
But there is a scenarion that throw a strange exception. So, the
client is connected to the server, I send a message from client to server
and viceversa and than I stop the server from the 'x' button from the
right-up corner; in that moment the client throw
System.NullReferenceException:

An unhandled exception of type 'System.NullReferenceException'
occurred in system.dll
Additional information: Object reference not set to an instance of an
object.

the cursor is placed here:
000000a0 0F B6 F0 movzx esi,al

and the Call Stack stopped here:

system.dll!System.Net.Sockets.OverlappedAsyncResul t.CompletionPortCallback(uint
errorCode = 64, uint numBytes = 0, System.Threading.NativeOverlapped*
nativeOverlapped = 1750608) + 0xa0 bytes

There is a solution?

Thank you in advance.

.:Alex:.


Feb 24 '06 #4

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

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
1
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of type 'System.NullReferenceException' occurred in...
7
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. When I try to do the following using asp.net 1.1: ...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
0
by: Matthias Kwiedor | last post by:
Hi! I want to create a WebBrowser Control at runtime. So i ported the "at start creation" of the Control to a new routine. Everything works fine, but i implement the BeforeNavigateFix and a...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
1
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ----------------------------------------------------------------------------...
2
by: sxiao | last post by:
Hi, there I got a NullReferenceException when there are more than one users trying to open the same page at the same time. The senerio is: Two users logged into the web application using the...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.