473,756 Members | 7,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.NullRefe renceException , 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.NullRefe renceException:

An unhandled exception of type 'System.NullRef erenceException ' 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!Syst em.Net.Sockets. OverlappedAsync Result.Completi onPortCallback( uint
errorCode = 64, uint numBytes = 0, System.Threadin g.NativeOverlap ped*
nativeOverlappe d = 1750608) + 0xa0 bytes

There is a solution?

Thank you in advance.

..:Alex:.
Feb 24 '06 #1
3 3657
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*******@yaho o.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.NullRefe renceException:

An unhandled exception of type 'System.NullRef erenceException ' 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!Syst em.Net.Sockets. OverlappedAsync Result.Completi onPortCallback( uint
errorCode = 64, uint numBytes = 0, System.Threadin g.NativeOverlap ped*
nativeOverlappe d = 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.NullRefe renceException

Let me know if you understand me.

Thank you for your attention.

..:Alex:.
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:OS******** ******@tk2msftn gp13.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*******@yaho o.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.NullRefe renceException:

An unhandled exception of type 'System.NullRef erenceException '
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!Syst em.Net.Sockets. OverlappedAsync Result.Completi onPortCallback( uint
errorCode = 64, uint numBytes = 0, System.Threadin g.NativeOverlap ped*
nativeOverlappe d = 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.mach in AT dot.state.fl.us > wrote
in message news:OS******** ******@tk2msftn gp13.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*******@yaho o.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.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.NullRefe renceException:

An unhandled exception of type 'System.NullRef erenceException '
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!Syst em.Net.Sockets. OverlappedAsync Result.Completi onPortCallback( uint
errorCode = 64, uint numBytes = 0, System.Threadin g.NativeOverlap ped*
nativeOverlappe d = 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
9143
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 system.windows.forms.dll
1
536
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 system.windows.forms.dll. Additional information: Object reference not set to an instance of an object. Visual Studio's IDE is not allowing me to develop projects in C#... I've trying to create a simple Windows Forms project using Visual Studio.NET...
7
8104
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: private void Page_Load(object sender, System.EventArgs e) { // load content XslTransform trans = new XslTransform();
0
9777
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" AutoPostBackOnNodeMove="false" DragAndDropEnabled="true" NodeEditingEnabled="False" KeyboardEnabled="true" CssClass="TreeView" NodeCssClass="TreeNode" SelectedNodeCssClass="SelectedTreeNode" HoverNodeCssClass="HoverTreeNode" NodeEditCssClass="NodeEdit"
0
2694
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 own Content Menu. For this i need this lines: public void create_new_browser()
2
7839
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 in treeview i display the content item in axWebBrowser, i close the sub form normally when i close the main the following error is generated An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll ...
1
4093
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. ---------------------------------------------------------------------------- ------------------------------------------- Public Class TestClass Public NextSubIndex As Integer = 1 Public arrTestSubClass() As TestSubClass
2
2782
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 Windows domain user account and tried to open the same page which has the databasde query code. When the two user tried to open the same page at the same time, there is a runtime error messsage showing as follows:
6
22221
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 Public Structure Attend Dim DaysTardy As Double
0
9384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9212
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9779
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8645
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6473
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5247
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2612
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.