|
From: Mr. J. <mr_...@ya...> - 2013-12-13 10:36:10
|
Hi ! I'm using VB.NET 2008 with FB SS 2.5 and FirebirdClient 2.7.7.0 I need to detect if current FB connection is local or over a network. Thanks. |
|
From: Jiri C. <di...@ci...> - 2013-12-13 11:30:19
|
Check the connection string (accessible from FbConnection).
--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com
|
|
From: Mr. J. <mr_...@ya...> - 2013-12-14 07:28:02
|
Hi !
"local" = database is on the same machine as application is
thanks.
On Friday, December 13, 2013 3:10 PM, Jiri Cincura <di...@ci...> wrote:
>Depends on what you think "local" (your original question) is.
On Fri, Dec 13, 2013 at 12:40 PM, Mr. John <mr_...@ya...> wrote:
> solution is to search in connecton string for 'localhost' or '127.0.0.1'
> ?
On Friday, December 13, 2013 3:10 PM, Jiri Cincura <di...@ci...> wrote:
On Fri, Dec 13, 2013 at 12:40 PM, Mr. John <mr_...@ya...> wrote:
> solution is to search in connecton string for 'localhost' or '127.0.0.1'
> ?
Depends on what you think "local" (your original question) is.
--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com |
|
From: Mr. J. <mr_...@ya...> - 2013-12-14 19:46:26
|
Hi,thanks Alexander,
I've put that condition:
If ",localhost,127.0.0.1,".Contains("," + My.Settings.Server_Name.Trim.ToLower + ",")
..................
EndIf
I don't know if that is the best way
thanks
On Saturday, December 14, 2013 1:55 PM, Alexander Muylaert-Gelein <amu...@ho...> wrote:
Hi
This parses a firebird path and scans for "loopback" or computername. You just need to add all possible IP's from you local PC and localhost.
good luck
a
private static void ReplaceLocalHost(ref string aServer)
{
s_OriginalDatabaseServer = aServer;
if (System.Environment.MachineName.Equals(aServer, StringComparison.OrdinalIgnoreCase) || ("127.0.0.1".Equals(aServer, StringComparison.Ordinal)))
{
aServer = "localhost";
}
}
private static char[] s_Splitter = new char[] { ':' };
private static bool SplitServerAndPort(string aPart, out string aServer, out int aPort)
{
var p = aPart.IndexOf('/');
if (p >= 0)
{
aServer = aPart.Substring(0, p);
if (int.TryParse(aPart.Substring(p + 1), out aPort))
{
ReplaceLocalHost(ref aServer);
return true;
}
return false;
}
else
{
aServer = aPart;
ReplaceLocalHost(ref aServer);
aPort = 3050;
return true;
}
}
public static bool SplitDatabaseTarget(string aDatabaseTarget, out string aServer, out int aPort,
out string aPath)
{
aServer = "localhost";
aPort = 3050;
aPath = null;
if (string.IsNullOrWhiteSpace(aDatabaseTarget))
{
return false;
}
var parts = aDatabaseTarget.Split(s_Splitter, StringSplitOptions.RemoveEmptyEntries);
switch (parts.Length)
{
case 0:
return false;
case 1:
// "webdb"
aPath = parts[0];
return true;
case 2:
// "c:\fast.fdb"
// "fast-server:webdb
// "fast-server/3052:webdb"
if (parts[0].Length == 1 && parts[1].StartsWith("\\"))
{
aPath = parts[0] + ":" + parts[1];
}
else
{
if (!SplitServerAndPort(parts[0], out aServer, out aPort))
{
return false;
}
aPath = parts[1];
}
return true;
case 3:
// "fast-server:c:\fast\fast.fdb
// "fast-server/3052:c:\fast\fast.fdb"
if (!SplitServerAndPort(parts[0], out aServer, out aPort))
{
return false;
}
if (parts[1].Length == 1 && parts[2].StartsWith("\\"))
{
aPath = parts[1] + ":" + parts[2];
return true;
}
return false;
default:
return false;
}
}
________________________________
Date: Fri, 13 Dec 2013 23:27:55 -0800
From: mr_...@ya...
To: fir...@li...
Subject: Re: [Firebird-net-provider] Detect current connection is local or network
Hi !
"local" = database is on the same machine as application is
thanks.
On Friday, December 13, 2013 3:10 PM, Jiri Cincura <di...@ci...> wrote:
>Depends on what you think "local" (your original question) is.
On Fri, Dec 13, 2013 at 12:40 PM, Mr. John <mr_...@ya...> wrote:
> solution is to search in connecton string for 'localhost' or '127.0.0.1'
> ?
On Friday, December 13, 2013 3:10 PM, Jiri Cincura <di...@ci...> wrote:
On Fri, Dec 13, 2013 at 12:40 PM, Mr. John <mr_...@ya...> wrote:
> solution is to search in connecton string for 'localhost' or '127.0.0.1'
> ?
Depends on what you think "local" (your original question) is.
--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-net-provider mailing list
Fir...@li...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |
|
From: Mark R. <ma...@la...> - 2013-12-15 09:01:48
|
On 13-12-2013 11:33, Mr. John wrote: > Hi ! > I'm using VB.NET 2008 with FB SS 2.5 and FirebirdClient 2.7.7.0 > I need to detect if current FB connection is local or over a network. Could you provide some detail on why you need to know this? Mark -- Mark Rotteveel |
|
From: Mr. J. <mr_...@ya...> - 2013-12-15 10:21:15
|
Hi When using my application over a network,only when it is update on the server machine,client applications must download also the update so I need to detect server or client state thanks On Sunday, December 15, 2013 11:01 AM, Mark Rotteveel <ma...@la...> wrote: On 13-12-2013 11:33, Mr. John wrote: > Hi ! > I'm using VB.NET 2008 with FB SS 2.5 and FirebirdClient 2.7.7.0 > I need to detect if current FB connection is local or over a network. Could you provide some detail on why you need to know this? Mark -- Mark Rotteveel |
|
From: Mercea P. <pau...@al...> - 2013-12-15 19:30:26
|
On 12/15/2013 12:21 PM, Mr. John wrote: > Hi > When using my application over a network,only when it is update on the > server machine,client applications must download also the update > so I need to detect server or client state > thanks Hi If you separate the client and the server, even if you work on same machine the client must be updated if is an update on 'server' side. I think you can achieve this by using a table for versioning (id, workstation,version,updated), or something similar. Best regards, Paul MERCEA ___________________________________________ E-mail: pau...@al... ___________________________________________ |
|
From: Mr. J. <mr_...@ya...> - 2013-12-16 06:37:20
|
That I also do, but I only apply database update scripts on server machine,also some users using default app installer installed also FB server on 'client' side.
I also want to warn about that.
thanks
On Sunday, December 15, 2013 9:14 PM, Mercea Paul <pau...@al...> wrote:
On 12/15/2013 12:21 PM, Mr. John wrote:
Hi
>When using my application over a network,only when it is update
on the server machine,client applications must download also the
update
>so I need to detect server or client state
>thanks
>
Hi
If you separate the client and the server, even if you work on same
machine the client must be updated if is an update on 'server' side.
I think you can achieve this by using a table for versioning (id,
workstation,version,updated), or something similar.
Best regards,
Paul MERCEA
___________________________________________
E-mail: pau...@al...
___________________________________________
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-net-provider mailing list
Fir...@li...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |
|
From: Mercea P. <pau...@al...> - 2013-12-16 08:06:00
|
On 12/16/2013 08:34 AM, Mr. John wrote: > > That I also do, but I only apply database update scripts on server > machine,also some users using default app installer installed also FB > server on 'client' side. > I also want to warn about that. > thanks Increment application version on server side, as final step in installation process and check in your client startup if meet the correct version. Update if necessary . You dont need to know if client run locally or remote, you need to have compatibility between client app and server/database structure. -- Paul MERCEA ___________________________________________ E-mail: pau...@al... ___________________________________________ |
|
From: Mr. J. <mr_...@ya...> - 2013-12-16 08:18:03
|
Hi, but how to detect app is running on server side or on local,I used to search for firebird process but I found as I said, fb was installed also on client side,so the trusted point to get that info is from firbird connection
thanks.
On Monday, December 16, 2013 10:05 AM, Mercea Paul <pau...@al...> wrote:
On 12/16/2013 08:34 AM, Mr. John wrote:
>That I also do, but I only apply database update scripts on
server machine,also some users using default app installer
installed also FB server on 'client' side.
>I also want to warn about that.
>thanks
>
Increment application version on server side, as final step in installation process and check in your client startup if meet the correct version.
Update if necessary . You dont need to know if client run locally or
remote, you need to have compatibility between client app and
server/database structure.
--
Paul MERCEA
___________________________________________
E-mail: pau...@al... ___________________________________________
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-net-provider mailing list
Fir...@li...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |
|
From: Mercea P. <pau...@al...> - 2013-12-16 09:05:10
|
On 12/16/2013 10:15 AM, Mr. John wrote: > Hi, but how to detect app is running on server side or on local,I used > to search for firebird process but I found as I said, fb was installed > also on client side,so the trusted point to get that info is from > firbird connection > > thanks. > > Check table MON$ATTACHMENTS,like: select a.mon$remote_process, a.mon$remote_address from MON$ATTACHMENTS a Regards, -- Paul MERCEA ___________________________________________ E-mail: pau...@al... ___________________________________________ |
|
From: Mr. J. <mr_...@ya...> - 2013-12-16 09:41:08
|
Hi,with that query
select a.mon$remote_process, a.mon$remote_address from
MON$ATTACHMENTS a
I get all connections+ip,something I miss,sorry:how to identify my current connection?
address 127.0.0.1 from the query means connection is on the server side?
thanks
On Monday, December 16, 2013 11:05 AM, Mercea Paul <pau...@al...> wrote:
On 12/16/2013 10:15 AM, Mr. John wrote:
Hi, but how to detect app is running on server side or on local,I used to search for firebird process but I found as I said, fb was installed also on client side,so the trusted point to get that info is from firbird connection
>
>thanks.
>
>
>
>
Check table MON$ATTACHMENTS,like:
select a.mon$remote_process, a.mon$remote_address from
MON$ATTACHMENTS a
Regards,
--
Paul MERCEA
___________________________________________
E-mail: pau...@al... ___________________________________________
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-net-provider mailing list
Fir...@li...
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |