DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 11 Aug 2007 03:42:50 -0700,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    cmrhema
          2    Peter Duniho


error while retrieving values from socket   
Hello,

We are currently using a program where we recieve the details from the
client. Developed in C#.It is recieved through sockets.
It is working fine. i.e. When we start the program afresh we do get
details properly. We recieve the data as strings and we store in a list
box.But after two or three days we have an error stating as below


System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.ListBox.ItemArray.IndexOf(Obj ect item, Int32
stateMask)
at System.Windows.Forms.ListBox.ObjectCollection.AddI nternal(Object
item)
at System.Windows.Forms.ListBox.ObjectCollection.Add( Object item)
at StepIIServer.Server.RunClient2() in E:\stepII\Server.cs:line 346
8/7/2007 8:19:26 PM Error :$<MSG.Info.ServerLogin>
$DeviceName=352022000365427
$Software=steppII_2.4.3_final
$Hardware=STEPPII-55
$LastValidPosition=$GPRMC,145245.573,A,2941.6635,N
,07659.7630,E,0.00,2.34,070807,,
$IMEI=352022000365427
$PhoneNumber=
$LocalIP=555.36.20.147
$CmdVersion=2
$SUCCESS
$<end>
&IMEI=352022000365427,Distance=63936,
&GPRMC,145240.574,A,2941.6635,N,07659.7630,E,0.00,2 .34,070807,,
<end>

and another error stating
ping
System.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sockets.Socket.Receive(Byte[] buffer)
at StepIIServer.Server.RunClient2() in E:\stepII\Server.cs:line 288
8/7/2007 5:51:34 AM Error :&IMEI=352022000370849,Distance=1487,
&GPRMC,001830.515,A,2943.0151,N,07658.9818,E,0.00,8 .79,070807,,
<end>

Will you please help

thanks
Hema


*** Sent via Developersdex http://www.developersdex.com ***
Date:Sat, 11 Aug 2007 03:42:50 -0700   Author:  

Re: error while retrieving values from socket   
cmrhema wrote:

> 
> Hello,
> 
> We are currently using a program where we recieve the details from the
> client. Developed in C#.It is recieved through sockets.
> It is working fine. i.e. When we start the program afresh we do get
> details properly. We recieve the data as strings and we store in a list
> box.But after two or three days we have an error stating as below


You didn't post any code, so the best anyone can do is guess.  My guess 
is this: you have a valid socket error (connection was reset, generating 
the one socket exception), which somehow results in you attempting to 
add a null string reference to your list box (generating the 
NullReferenceException).

Fix your socket error handling so that it catches the reset connection 
exception and doesn't try to add a null reference to the ListBox, and I 
would guess the NullReferenceException will go away.  You'll still get 
the SocketException, but since you'll be handling it, that's okay.

Pete
Date:Sat, 11 Aug 2007 10:44:32 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us