[Mono-list] Problem closing Streams

Carlos Guzmán Álvarez carlosga@telefonica.net
Tue, 21 Jan 2003 23:16:46 +0100


Hello:


I´m making test of the Firebird ADO.NET provider on linux Red Hat 8.0 
with the latest sources of mono, i have a problem, I have BinaryReader 
used for reading data sent by the server, and a BinaryWriter for send 
data to the server created as:

	db.Output = new XdrOutputStream(new 
BufferedStream((System.IO.Stream)db.DbNetworkStream));
	
	db.Input  = new XdrInputStream(new 
BufferedStream((System.IO.Stream)db.DbNetworkStream));


When i disconnect from a database i make:

	db.Input.Close();
	db.Output.Close();  // Here gives an exception
	db.DbNetworkStream.Close();
	...


This works well on Ms .Net, and it has been working well on old versions 
of mono (0.17).



The exception is:

Unhandled Exception: System.ObjectDisposedException: The object was used 
after being disposed
in <0x00094> 00 System.Net.Sockets.NetworkStream:CheckDisposed ()
in <0x00186> 00 System.Net.Sockets.NetworkStream:Write (byte[],int,int)
in <0x00181> 00 System.IO.BufferedStream:Flush ()
in <0x00014> 00 System.IO.BufferedStream:Close ()
in <0x00052> 00 System.IO.BinaryWriter:Dispose (bool)
in <0x00019> 00 System.IO.BinaryWriter:Close ()
in <0x000a7> 00 FirebirdSql.Data.NGDS.isc_db_handle_impl:Invalidate ()
in <0x0005a> 00 FirebirdSql.Data.NGDS.GDS:Disconnect 
(FirebirdSql.Data.NGDS.isc_db_handle_impl)
in <0x00224> 00 FirebirdSql.Data.NGDS.GDS:isc_detach_database 
(FirebirdSql.Data.INGDS.isc_db_handle)
in <0x0003b> 00 FirebirdSql.Data.Firebird.FbIscConnection:Close ()
in <0x0024c> 00 FirebirdSql.Data.Firebird.FbConnection:Close ()
in <0x0001f> 00 AS3AP.BenckMark.FirebirdBackend:DatabaseDisconnect ()
in <0x00068> 00 AS3AP.BenckMark.FirebirdBackend:DatabaseDisconnect ()
in <0x000fc> 00 AS3AP.BenckMark.Benchmark:Main (string[])




-- 
Best regards

Carlos Guzmán Álvarez
Vigo-Spain

"No tengo dones especiales.Sólo soy apasionadamente curioso"
Albert Einstein, científico.