Actually, this is a problem I noticed in some of my own code as well. The
solution is to try and parse the string as an IP address before calling
Dns.GetHostEntry, like so:

 

IPAddress addr;

if (!IPAddress.TryParse(dataSource, out addr))
{

    addr = Dns.GetHostEntry(dataSource).AddressList[0];

}

 

Or something (I don't remember the exact syntax).

 

Dean.

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Cosmin Sandu
Sent: Friday, 17 August 2007 10:20 PM
To: firebird-net-provider@lists.sourceforge.net
Subject: Re: [Firebird-net-provider] Connection problem from Win 2003
Standard

 

I did some more tests by debugging with the sources of 
FirebirdSql.Data.FirebirdClient (version 2.5.0 Alpha 1,
the latest) and I isolated the error to this:

 

in:

 

GdsConnection.cs

 

function:

 

private IPAddress GetIPAddress(string dataSource, AddressFamily
addressFamily)

 

the line:

 

IPAddress[] addresses = Dns.GetHostEntry(dataSource).AddressList;

 

returns a single address, that also matches the "addressFamily" 
parameter (that is "InterNetwork"), and that address is "127.0.0.1".
The "dataSource" parameter is "192.168.100.55", my Interbase server.
It is clear that when the provider tries to connect to "127.0.0.1" on
port 3050 further in the code, it comes up with an error 
(obviously, my Interbase server isn't
on the localhost, it's on 192.168.100.55).

 

The comp on which i'm running the C# application 
has 2 network cards, with 2 different IP addresses and 2
different gateways (one in the class 192.168.100.x and the other in
192.168.1.x).
So I thought that the connection request doesn't come out on the right
NIC (the "good" one is 192.168.100.x, the other is a NAS storage).

 

I changed the binding order of the NIC's, now 192.168.100.x is 
the first one (Control Panel/Network Connections/Advanced menu),
I listed the hosts with this code:

 

            string sHostName = Dns.GetHostName();
            IPHostEntry ipE = Dns.GetHostEntry(sHostName);
            IPAddress[] IpA = ipE.AddressList;
            for (int i = 0; i <= IpA.Length - 1; i++ )
            {
                textBox1.Text += IpA[i] + "\r\n";
            }

 

and the order is now correct. Still, the problem remains,
the line in GdsConnection.cs returns the same 127.0.0.1.

 

Any ideas, because I'm out ?!

""Cosmin Sandu"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hello,

 

 

I have a connection problem from a Windows 2003 Standard Edition using
FibProvider from a C#2005 application to an Interbase Server.

 

The system I use is the following:

 

Application written in C#2005, .Net Framework 2.0, FibProvider 2.0, hosted
on a Windows 2003 Standard Edition.

 

The database server is an Interbase 6.0 Open Source hosted on a Linux
server.

 

The application cannot connect to the database server from the Windows 2003
server but if i move the application to another station, an XP station, it
works perfectly.

 

The error that i receive is something like ... "cannot connect to the remote
server. The server actively refuse it".

 

I presume it has something to do with the Windows 2003 settings... 

 

If you can help me, i would very much appreciate it...

 

 

 

Thank you


  _____  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/ 


  _____  


_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to