467,927 Members | 2,002 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,927 developers. It's quick & easy.

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
  • viewed: 3342
Share:
3 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Terrence | last post: by
1 post views Thread by msnews.microsoft.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.