Re: [Mono-dev] Patch to add the support of TDS 8 to SqlClient

2007-01-11 Thread Dmitry Key

Hi, Naggapan!

I attached my test program. It's very simple but cover all new features that 
I added. This sample uses 'pubs' database and 'employee' data table. Also 
you can change column collation in the 'employee' table.


Actually the most interestring stuff is Ssl/Tls settings for the SQL Server 
2000/2005. I used the info taken from 
http://support.microsoft.com/kb/316898.


The certificate was generated as

makecert -r -n CN=yourcert -p12 yourcert.p12 yourpasswd

This Certificate was imported as DER-encoded X.509 (.CER) file:

certmgr -add -c Trust yourcert.cer

Please take into account that in the string CN=yourcert the parameter 
yourcert has to coincide with the SQL Server host name. It corresponds to 
the behaviour of the SqlClient in the .Net Framework 1.1. The ADO.NET 2.0 
supports the additional parameter TrustServerCertificate that can be 
implemented easily in the Mono-2.0 (TdsComm.CertificateValidation should 
return true if TrustServerCertificate is true|yes).


With best wishes,
Dmitry S. Kataev

_
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


SqlClient.cs
Description: Binary data


SqlClient.exe.config
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] TDS 8.0 and SslClientStream

2006-11-27 Thread Dmitry Key
Hi, all

I am working on TDS 8.0 network protocol for the SqlClient and facing with 
the problem of the handshaking implementation. The corresponding TDS packet 
consists of the TDS header and TDS body with the TLS handshake packet. So to 
parse server response we have to read entire TDS packet, analyze its type 
and, if necessary, extract TLS part and send it to the SslClientStream 
class. But this class uses asynchronous Stream.BeginRead/EndRead methods in 
the handshake procedure and it is impossible read data asynchronously from 
the internal buffer. I see two methods to resolve such a problem.
1) Rewrite handshake code of the SslClientStream/SslBaseStream in the 
synchronous manner. Another reason to do it is the following: SslStream 
class from .Net 2.0 uses synchronous methods to make handshake and as far as 
I understand Mono version of this class will be implemented on the basis of 
the Mono.Security.
2) Implement IAsyncResult interface in such a way that it will be possible 
to read data from memory buffer asynchronously. I suppose it can be done as 
the extension of the MemoryStream class.

In any case the good knowledge of Mono.Security internals is required. So 
could some Mono guru help me to solve my problem?

_
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] question on the Socket class

2006-09-05 Thread Dmitry Key
Hi, all!

In the C# code below I try to check during given timeout whether host is 
available or not. This code is working fine under .Net with the following 
output:

10035
Time: 5,040425 seconds

For the Mono 1.1.13/Debian

10035
Test Failed:   1,660835 seconds

Could somebody explain what I did wrong in my code?
Ignoring of the socket errors #10035 and #10035 is under suspicion, but I 
have read in the documentation that these errors can be skipped.

using System;
using System.Net;
using System.Net.Sockets;
using System.Collections;

namespace ConsoleApplication1
{
/// summary
/// Summary description for Class1.
/// /summary
///

class Class1
{
/// summary
/// The main entry point for the application.
/// /summary
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//

DateTime start = DateTime.Now;

try
{//host 1.1.1.1:8080, timeout 5 seconds
CheckConnection(1.1.1.1, 8080, 5);
}
catch(Exception)
{
Console.Out.WriteLine(Time:  + 
DateTime.Now.Subtract(start).TotalSeconds.ToString() +  seconds);
return;
}

Console.Out.WriteLine(Test failed:  + 
DateTime.Now.Subtract(start).TotalSeconds.ToString() +  seconds);
return;
}

public static void CheckConnection(string host, int port, int 
timeout)
{
Socket sock = new Socket(AddressFamily.InterNetwork, 
SocketType.Stream, 
ProtocolType.Tcp);
bool isConnected = false;

IPHostEntry entries = Dns.GetHostByName(host);
foreach (IPAddress ipAddr in entries.AddressList)
{
sock.Blocking = false;
try
{
sock.Connect(new IPEndPoint(ipAddr, 
port));
}
catch (SocketException ex)
{

Console.Out.WriteLine(ex.ErrorCode.ToString());
// ignore errors:
// Resource temporarily unavailable.
// Operation now in progress.
if (ex.ErrorCode != 10035  
ex.ErrorCode != 10036)
throw;
}

ArrayList checkWrite = new ArrayList();
checkWrite.Add(sock);
ArrayList checkError = new ArrayList();
checkError.Add(sock);

Socket.Select(null, checkWrite, checkError, 
timeout * 100);
sock.Blocking = true;
sock.Close();

isConnected = checkWrite.Count  0;

if (isConnected)
break;
}

if (!isConnected)
throw new Exception();
}
}
}

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Official invitation letter to the Mono meeting

2006-08-29 Thread Dmitry Key
Hi, all!

I would like to participate in the Mono conference. Unfortunately my 
American visa has expired. Is it possible get an official invitation letter 
to the meeting for the US Embassy?

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] new version of ADO.NET provider for MaxDB is released

2006-08-24 Thread Dmitry Key

Hi All

The ADO.NET provider for MaxDB version 0.8 is released (see 
http://www.sf.net/projects/maxdbprovider). Some bugs are fixed in the 
Interop module (thanks to Kornél Pál for the help) so provider looks less or 
more workable for mono-1.0 profile.


Also I have one question to ADO.NET/Mono team. I would like to get more 
feedbacks from MaxDB users. Is it possible to add link to the MaxDB Provider 
project on Mono/Data Access web page?


_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] UnmanagedType.LPWStr and Big-Endian Unicode

2006-08-12 Thread Dmitry Key
Hi

One has the following function declaration:

[DllImport(libSQLDBC_C)]
public unsafe extern static SQLDBC_Retcode 
SQLDBC_PreparedStatement_prepareNTS(
IntPtr stmt,
[MarshalAs(UnmanagedType.LPWStr)]string query,
SQLDBC_StringEncodingType encoding);

It is obvious that for the Little-Endian hardware the string query will be 
translated to the Little-Endian null-terminated Unicode string. But what 
happens for the Big-Endian architecture? I could not find answer for this 
question in the Mono documention.

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] The beta version of ADO.NET provider for MaxDB database

2006-08-09 Thread Dmitry Key
Hi Nagappan

I filed the bug #79041  (http://bugzilla.ximian.com/show_bug.cgi?id=79041)

Please take into account that attached file is Tar/GZip archive.

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] The beta version of ADO.NET provider for MaxDB database

2006-08-07 Thread Dmitry Key
Hi!

I am currently working on an ADO.Net Provider for MaxDB that is registered 
in the SourceForge.net (see http://sourceforge.net/projects/maxdbprovider). 
The binaries are compiled for Net-1.1, Net-2.0 and Mono-1.0. Since the 
ADO.NET 2.0 is still in the development phase I can not build version for 
Mono-2.0. Provider is written in C# and can be compiled as fully managed 
assembly or managed wrapper for MaxDB client library. The former is more 
stable and portable the latter has better performance.
I have the following question to the Mono developers:
1) When ADO.NET 2 implementation will be complete? Will it be included in 
the Mono 1.2?
2)  I ran unit tests in the Debian Linux/Mono 1.1.13 and SUSE 9/Mono 1.1.16 
and the fully managed version was working less or more stable. But the 
unsafe provider failed dramatically with SIGSEGV signal. I checked program 
compiled by Mono 1.1.13 under .Net Framework 1.1 and everything worked fine. 
Thus the Mono P/Invoke mechanism is under suspicion. Could somebody give me 
some hint how to resolve this issue?
3) Could somebody help me to run test cases on the Big Endian hardware?

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] The beta version of ADO.NET provider for MaxDB database

2006-08-07 Thread Dmitry Key
Hi, Nagappan

1. The preview version of ADO.NET will be available with Mono 1.2.

Ok

2. Can you please give more details regarding the SIGSEGV ? Procedures
to reproduce the bug ?
I try to run test cases which are working perfectly on .Net (see 
http://svn.sourceforge.net/viewvc/maxdbprovider/MaxDBConsole/UnitTesting/)

the command line is
nunit-console /fixture=MaxDB.UnitTesting.CommandTests MaxDB.Test.exe

Output is

NUnit version 2.2.7
Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. 
Vorontsov, Charlie Poole.
Copyright (C) 2000-2003 Philip Craig.
All Rights Reserved.

OS Version: Unix 2.6.8.2Mono Version: 1.1.4322.2032


=
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=

Stacktrace:

in 0x4 (wrapper managed-to-native) System.Object:__icall_wrapper_g_free 
(intptr)
in 0x6b9d0c (wrapper managed-to-native) 
System.Object:__icall_wrapper_g_free (intptr)
in 0xff19 (wrapper managed-to-native) 
MaxDB.Data.Utilities.UnsafeNativeMethods:SQLDBC_ErrorHndl_getSQLState 
(intptr)
in 0x31 MaxDB.Data.MaxDBException:ThrowException 
(string,intptr,System.Exception)
in 0xf MaxDB.Data.MaxDBException:ThrowException (string,intptr)
in 0x1b8 MaxDB.Data.MaxDBCommand:BindAndExecute 
(intptr,MaxDB.Data.MaxDBParameterCollection[])
in 0xb8 MaxDB.Data.MaxDBCommand:ExecuteNonQuery ()
in 0x3a MaxDB.UnitTesting.BaseTest:ExecuteNonQuery (string)
in 0x19 MaxDB.UnitTesting.BaseTest:DropTestTable ()
in 0x100 MaxDB.UnitTesting.BaseTest:Init (string)
in 0xf MaxDB.UnitTesting.CommandTests:SetUp ()
in 0xfef34747 (wrapper runtime-invoke) System.Object:runtime_invoke_void 
(object,intptr,intptr,intptr)
in 0x4 (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
in 0x23418d (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
in 0x8d System.Reflection.MonoMethod:Invoke 
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
in 0x1a System.Reflection.MethodBase:Invoke (object,object[])
in 0x2d NUnit.Core.Reflect:InvokeMethod 
(System.Reflection.MethodInfo,object)
in 0x5f NUnit.Core.TestFixture:DoFixtureSetUp (NUnit.Core.TestResult)
in 0xcb NUnit.Core.TestSuite:DoOneTimeSetUp (NUnit.Core.TestResult)
in 0xd1 NUnit.Core.TestSuite:Run 
(NUnit.Core.EventListener,NUnit.Core.IFilter)
in 0x1e7 NUnit.Core.TestSuite:RunAllTests 
(NUnit.Core.TestSuiteResult,NUnit.Core.EventListener,NUnit.Core.IFilter)
in 0xe4 NUnit.Core.TestSuite:Run 
(NUnit.Core.EventListener,NUnit.Core.IFilter)
in 0x155 NUnit.Core.SimpleTestRunner:Run 
(NUnit.Core.EventListener,NUnit.Core.Test[])
in 0x60 NUnit.Core.SimpleTestRunner:Run 
(NUnit.Core.EventListener,string[])
in 0x2c NUnit.Core.TestRunnerThread:TestRunnerThreadProc ()
in 0xfffaf630 (wrapper delegate-invoke) 
System.MulticastDelegate:invoke_void ()
in 0xff173af7 (wrapper runtime-invoke) System.Object:runtime_invoke_void 
(object,intptr,intptr,intptr)

Native stacktrace:

/usr/lib/libmono.so.0(mono_handle_native_sigsegv+0xe5) [0x40094485]
/usr/lib/libmono.so.0 [0x400554dd]
[0xe440]
/usr/lib/libglib-2.0.so.0(g_free+0x22) [0x40224c92]
[0x4112f283]
[0x417e8f6d]
[0x417e8e4a]
[0x417e8e00]
[0x417e3ec9]
[0x417e3571]
[0x417e3173]
[0x417e30c2]
[0x41146121]
[0x41145d98]
[0x4113e1a1]
/usr/lib/libmono.so.0 [0x400728c0]
/usr/lib/libmono.so.0(mono_runtime_invoke+0x33) [0x400d68c3]
/usr/lib/libmono.so.0(mono_runtime_invoke_array+0x1b0) [0x400dae20]
/usr/lib/libmono.so.0 [0x400e1e17]
[0x40eef02a]
[0x4112318e]
[0x40f44e03]
[0x41145d06]
[0x4113dea0]
[0x4113d764]
[0x4113d3f2]
[0x4113d9b8]
[0x4113d405]
[0x4113ceee]
[0x4113cd49]
[0x4113cc9d]
[0x40f4f7f0]
[0x40efedf1]
/usr/lib/libmono.so.0 [0x400728c0]
/usr/lib/libmono.so.0(mono_runtime_invoke+0x33) [0x400d68c3]
/usr/lib/libmono.so.0(mono_runtime_delegate_invoke+0x46) 
[0x400d7bc6]
/usr/lib/libmono.so.0 [0x4010a2d6]
/usr/lib/libmono.so.0 [0x40157794]
/usr/lib/libmono.so.0(GC_start_routine+0x63) [0x40172f03]
/lib/tls/libpthread.so.0 [0x40299cfd]
/lib/tls/libc.so.6(__clone+0x5e) [0x403a413e]
Aborted

I ran these tests on Debian Linux/Mono 1.1.13 and SLES 9/Mono 1.1.16. As far 
as I understand the problem is the function from SQLDBC_C library 
SQLDBC_ErrorHndl_getSQLState. But if I remove this function the following 
output takes place:

NUnit version 2.2.7
Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. 
Vorontsov, Charlie Poole.
Copyright (C) 2000-2003 Philip Craig.