473,748 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delegates are useful, and here is why (sample program)

They usually don't teach you in most textbooks I've seen that
delegates can be used to call class methods from classes that are
'unaware' of the delegate, so long as the class has the same signature
for the method (i.e., as below, int Square (int)).

Here is an example to show that feature. Note class "UnAwareCla ss"
has its methods Square and Cuber called by a class DelegateClass.
This is because these methods in UnAwareClass have the same signature
and so they can be called by DelegateClass, without the keyword
'delegate' ever appearing in UnAwareClass.

Note the keyword 'static' has to be used as below, even though
UnAwareClass itself is not static, though there is a way to use
delegates with non-static functions (however I don't see the need to
do so).

Pretty cool if you ask me--like a functor in C++.

RL

//Delegate model showing how another class (“UnAwareClass” ) does not
even have to be aware of the delegate and still be called and
employed.
///

///////
// OUTPUT (takes the square of a number, here 11, and the cube, to
give 121 and 1331)

...now for external use of delegates from two classes...
Square 11 is: 121
!Cube 11 is: 1331
Press any key to continue . . .
///////

using System;
using System.Collecti ons.Generic;
using System.Text;

namespace EventDelegates
{
class Program
{
static void Main(string[] args)
{

UnAwareClass myUnAwareClass = new UnAwareClass();

// now to access delegate from another class

Console.WriteLi ne("...now for external use of delegates from two
classes...");

DelegateClass.P ublicHigherPowe r2 sQr = new
DelegateClass.P ublicHigherPowe r2(UnAwareClass .Square); //!!! Note: how
called: UnAwareClass.Sq uare

DelegateClass myDelegateClass = new DelegateClass() ; //
apparently no ill effects if follows rather than preceeds previous
line

int ji2 = myDelegateClass .DoOp(sQr, 11);

Console.WriteLi ne("Square 11 is: {0}", ji2);

DelegateClass.P ublicHigherPowe r2 Cub2 = new
DelegateClass.P ublicHigherPowe r2(UnAwareClass .Cuber);

//!!! note: how called: UnAwareClass.Cu ber

ji2 = myDelegateClass .DoOp(Cub2, 11);

Console.WriteLi ne(" !Cube 11 is: {0}", ji2);

// !!!Note significance: 'delegate' keyword NEVER APPEARS in class
UnAwareClass (!)

}
}
}
////////////
using System;
using System.Collecti ons.Generic;
using System.Text;

namespace EventDelegates
{
class UnAwareClass
{

//!! in this version, 'delegate' keyword does not appear in
this class (UnAwareClass) but only DelegateClass class

int[] values;
int i;
public UnAwareClass()
{
values = new int[] { 1, 2, 3 }; //not used
i = 22333; //not used
}
public static int Square(int x)
{
return x * x;
}
public static int Cuber(int y)
{
return y * y * y;
}
}

class DelegateClass
{
public delegate int PublicHigherPow er2(int x); //delegate to
be used externally (keyword delegate must of course be declared here)

int j;
public DelegateClass()
{
j = 0;
}

public int DoOp(PublicHigh erPower2 ar, int x) //note format
{
return ar(x);
}
}

}
Jul 13 '08 #1
69 5584
Was there a question? (which is kinda what this group is aimed at...)

But I'm not sure that this is a massively useful example of
delegates... in particular, Main could simply use the actual method
directly, rather than using delegates. Delegates become useful when
the code that invokes them cannot possibly know about the actual
methods (such as List<T>.Find). I'm counting "Main" as the calling
code since DelegateClass/DoOp don't actually add anything - Main could
just as easily call sQr(11) and Cub2(11).

Re delegate not appearing in UnAwareClass, I'm not sure that should
surprise us? By comparison to C++, the targeteted method wouldn't know
about a void-pointer, either. And theer is a lot of unused stuff...
(i, j, values, 2 constructors) - it just adds confusion.

Note that .NET 3.5 adds some re-usable generic delegates such as
Func<int,inttha t can be used in place of declaring your own.

Just some pointers... [no pun intended]

Marc
Jul 13 '08 #2
On Jul 13, 12:56*am, Marc Gravell <marc.grav...@g mail.comwrote:
Was there a question? (which is kinda what this group is aimed at...)
No, it was a comment.
>
But I'm not sure that this is a massively useful example of
delegates... in particular, Main could simply use the actual method
directly, rather than using delegates.
Please. You realize that delegates are not even necessary, ever, and
you can do everything a delegate can do (even an Event delegate that
publishes and is subscribed to) with simple calls to methods. More
clumsy and a code maintenance nightmare, but it works. Delegates are
just a programming paradigm. Some say delegates and events were
introduced in the CLI langauges of C++ and C# by Microsoft to make
them more compatible to Visual Basic (I read that once).
>
Re delegate not appearing in UnAwareClass, I'm not sure that should
surprise us?
Well it surprised me, since all the examples in my numerous textbooks
were contra.
Note that .NET 3.5 adds some re-usable generic delegates such as
Func<int,inttha t can be used in place of declaring your own.
Don't see how this is relevant--generic templates are well known and
another subject.

Thanks for replying. Happy coding.

RL
Jul 13 '08 #3
On Jul 13, 1:16*pm, raylopez99 <raylope...@yah oo.comwrote:
Please. *You realize that delegates are not even necessary, ever, and
you can do everything a delegate can do (even an Event delegate that
publishes and is subscribed to) with simple calls to methods. *More
clumsy and a code maintenance nightmare, but it works. *Delegates are
just a programming paradigm. *Some say delegates and events were
introduced in the CLI langauges of C++ and C# by Microsoft to make
them more compatible to Visual Basic (I read that once).
Delegates are just function pointers closed over the first argument of
the function. Events are just syntactic sugar for the Observer
pattern. There is no "paradigm" to them, and they have little to do
with VB6, either: VB6 had events which were vaguely similar
syntactically, but not delegates. A better example would be Delphi -
it had "function of object" type which was almost equivalent to C# non-
multicast delegates.
Jul 13 '08 #4
On Jul 13, 3:54*am, Pavel Minaev <int...@gmail.c omwrote:
Delegates are just function pointers closed over the first argument of
the function. Events are just syntactic sugar for the Observer
pattern. There is no "paradigm" to them, and they have little to do
with VB6, either: VB6 had events which were vaguely similar
syntactically, but not delegates. A better example would be Delphi -
it had "function of object" type which was almost equivalent to C# non-
multicast delegates.
Thanks for that insight. I stand corrected and after reading
Wikipedia's entry, I understand what syntactic sugar means.

RL

Jul 13 '08 #5
Here is an updated version of this program I worked on today, that
shows 'inline or anonymous delegates' (at least for version 2.0, since
I don't have version 3.0 of C#), multicasting (and the syntax for it),
traversing an array of delegates. If anybody cares to comment, please
post how in version 3.0 you would declare a (anonymous) delegate
"inline" and 'inside' a class method (see comment below: "; //cannot
declare here! compiler errror, must be done outside of class method--
one disadvantage apparently of version 2.0" and, "//NOT ALLOWED! must
be outside of...")

RL

// start of output

....now for external use of delegates from two classes...
Square inside method:121
Square 11 is: 121
Cube inside method:1331
!Cube 11 is: 1331
z:123
number returnINT 123 is: 123
z:345
number returnINT 345 is: 345
............... ...
now try multicasting delegates that accept a single parameter
the number of delegates in this list is: 5
Square inside method:12321
Cube inside method:1367631
z:111
Cube inside method:1367631
z:111
....now remove a chained delegate, say sQr, from the invocation list...
the number of delegates in this list is: 4
.............__ ______......... ..
demonstrate that parameter returned for val is an integer, as
expected;
One advantage of delegates over Events is that a delegate can return a
value dir
ectly,and doesn't have to be void
.............__ ______......... ..
Cube inside method:1367631
the integer returned in the multicast delegate is: 1367631
z:111
the integer returned in the multicast delegate is: 111
Cube inside method:1367631
the integer returned in the multicast delegate is: 1367631
z:111
the integer returned in the multicast delegate is: 111
New Style Delegate: fourth power of ten is 10k: 10000
Press any key to continue . . .

// end of output

using System;
using System.Collecti ons.Generic;
using System.Text;

namespace del071308
{

class Program
{
public delegate int NewStyleDelegat e(int i); //used later on
below for 'new style' static method delegate without need for a class
instantiation, but done inline

static void Main(string[] args)
{

UnAwareClass myUnAwareClass = new UnAwareClass();
// now to access delegate from another class

Console.WriteLi ne("...now for external use of delegates
from two classes...");

DelegateClass.P ublicHigherPowe r2 sQr = new
DelegateClass.P ublicHigherPowe r2(UnAwareClass .Square); //!!! Note: how
called: UnAwareClass.Sq uare

DelegateClass myDelegateClass = new DelegateClass() ;
// apparently no ill effects if follows rather than
preceeds previous line

int ji2 = myDelegateClass .DoOp(sQr, 11);

Console.WriteLi ne("Square 11 is: {0}", ji2);

DelegateClass.P ublicHigherPowe r2 Cub2;
Cub2 = new
DelegateClass.P ublicHigherPowe r2(UnAwareClass .Cuber); //long way - 2
lines instead of one

DelegateClass.P ublicHigherPowe r2 RetINT;
RetINT = new
DelegateClass.P ublicHigherPowe r2(myUnAwareCla ss.returnINT);

DelegateClass.P ublicHigherPowe r2 RetINT2 = new
DelegateClass.P ublicHigherPowe r2(myUnAwareCla ss.returnINT); //note
format equivalent
//!!! note: how called: UnAwareClass.Cu ber

ji2 = myDelegateClass .DoOp(Cub2, 11);

Console.WriteLi ne(" !Cube 11 is: {0}", ji2);

// !!!Note significance: 'delegate' keyword NEVER APPEARS
in class UnAwareClass (!)

int uiu = 0;
uiu = myDelegateClass .DoOp(RetINT, 123);
Console.WriteLi ne("number returnINT 123 is: {0}", uiu);

int iui;
iui = myDelegateClass .DoOp(RetINT2, 345);
Console.WriteLi ne("number returnINT 345 is: {0}", iui);
//now try multicasting, combining delegates. Note
multicasting is less flexible in a way since only one parameter can be
passed that is common to all delegates

Console.WriteLi ne("........... ......");

Console.WriteLi ne("now try multicasting delegates that
accept a single parameter");
DelegateClass.P ublicHigherPowe r2 CombinedDelegat es01;
CombinedDelegat es01 = sQr + Cub2;
CombinedDelegat es01 += RetINT;
//add another delegate, and instantiate at the same time
CombinedDelegat es01 += new
DelegateClass.P ublicHigherPowe r2(UnAwareClass .Cuber);
CombinedDelegat es01 += RetINT2; //add yet another delegate

int delegateInvocat ionCount =
CombinedDelegat es01.GetInvocat ionList().GetLe ngth(0);
Console.WriteLi ne("the number of delegates in this list
is: {0}", delegateInvocat ionCount);
// CombinedDelegat es01.GetInvocat ionList(); // is An array
of delegates representing the invocation list of the current delegate
//easy way to traverse an array of unknown length, rather
than using GetLength property
(CombinedDelega tes01.GetInvoca tionList().GetL ength(0);) is to use
foreach:

foreach (DelegateClass. PublicHigherPow er2 val in
CombinedDelegat es01.GetInvocat ionList())
{
val.Invoke(111) ; //uses variable 111 as parameter
(req'd)

}
//now remove a chained delegate, say sQr, from the
invocation list
Console.WriteLi ne("...now remove a chained delegate, say
sQr, from the invocation list...");

CombinedDelegat es01 -= sQr; //note format to remove
// run array of delegates again, and see that this
delegate now missing
delegateInvocat ionCount =
CombinedDelegat es01.GetInvocat ionList().GetLe ngth(0);
Console.WriteLi ne("the number of delegates in this list
is: {0}", delegateInvocat ionCount);

// CombinedDelegat es01.GetInvocat ionList(); // is An array
of delegates representing the invocation list of the current delegate

//easy way to traverse an array of unknown length, rather
than using GetLength property
(CombinedDelega tes01.GetInvoca tionList().GetL ength(0);) is:

foreach (DelegateClass. PublicHigherPow er2 val in
CombinedDelegat es01.GetInvocat ionList())
{
}

Console.WriteLi ne("........... .________...... .....");
Console.WriteLi ne("demonstrat e that parameter returned for
val is an integer, as expected;");
Console.WriteLi ne("One advantage of delegates over Events
is that a delegate can return a value directly,"
+ "and doesn't have to be void");
Console.WriteLi ne("........... .________...... .....");

foreach (DelegateClass. PublicHigherPow er2 val in
CombinedDelegat es01.GetInvocat ionList())
{
// also demonstrate that parameter returned for val is
an integer, as expected

int j = val.Invoke(111) ; //uses variable 111 as
parameter (req'd)
Console.WriteLi ne("the integer returned in the
multicast delegate is: {0}", j);

}
// now demonstrate 'new style C#3.0' static method for
delegates (no need for a class, or, rather, done inline)

// public delegate int NewStyleDelegat e (int i); //
cannot declare here! compiler errror, must be done outside of class
method--one disadvantage apparently of version 2.0

NewStyleDelegat e FourthPower = delegate(int i)
{
return i * i * i * i;
};

int for4thPowerTen = FourthPower.Inv oke(10);

Console.WriteLi ne("New Style Delegate: fourth power of ten
is 10k: {0}", for4thPowerTen) ;

// Console.WriteLi ne("now an inline new style anonymous
method delegate is shown for C# 3.0");

{ //start of local variable bracket

// delegate int NewStyleDelegat e2(int i); //NOT
ALLOWED! must be outside of class method main(), apparently since this
compiler is Version 2.0 (C# 2005), not Ver. 3.0

} // end of local variable bracket

}
}
class UnAwareClass
{

//!! in this version, 'delegate' keyword does not appear in this class
(UnAwareClass) but only DelegateClass class
int[] values;
int i;
public UnAwareClass()
{
values = new int[] { 1, 2, 3 }; //not used
i = 1; //not used
}
public static int Square(int x)
{
int sq = x * x;
Console.WriteLi ne("Square inside method:{0}", sq);
return x * x;
}
public static int Cuber(int y)
{
int Cube = (int)Math.Pow(( double)y, (double)3); // that
is, Cube = y * y * y;
Console.WriteLi ne("Cube inside method:{0}",Cub e);
return Cube;
}

public int returnINT(int z) //non-static member function that
matches the delegate signature of: int Foo (int)
{
Console.WriteLi ne("z:{0}", z);
return z;
}
}

class DelegateClass
{
public delegate int PublicHigherPow er2(int x); //delegate to
be used externally (keyword delegate must of course be declared here)

int j;
public DelegateClass()
{
j = 0;
}

public int DoOp(PublicHigh erPower2 ar, int x) //note format
{
return ar(x);
}
}
}
////////////
Jul 13 '08 #6
On Jul 13, 4:40*pm, raylopez99 <raylope...@yah oo.comwrote:
Here is an updated version of this program I worked on today, that
shows 'inline or anonymous delegates' (at least for version 2.0, since
I don't have version 3.0 of C#), multicasting (and the syntax for it),
traversing an array of delegates. *If anybody cares to comment, please
post how in version 3.0 you would declare a (anonymous) delegate
"inline" and 'inside' a class method (see comment below: "; //cannot
declare here! compiler errror, must be done outside of class method--
one disadvantage apparently of version 2.0" and, "//NOT ALLOWED! must
be outside of...")
No, I don't believe that code would ever have worked. You can't
declare another type inside a method, which is what you were trying to
do.

If you believe it would have worked with the C# 1 compiler, please
post a short but complete program demonstrating that. I'll see if I
can find a machine with .NET 1.1 on to compile it with - but I don't
believe you'll find it's ever worked.

Be aware that there's a big difference between declaring a delegate
*type* and declaring a *variable* of a delegate type.

Jon
Jul 13 '08 #7
On Sun, 13 Jul 2008 08:40:09 -0700, raylopez99 <ra********@yah oo.com>
wrote:
Here is an updated version of this program I worked on today, that
shows 'inline or anonymous delegates' (at least for version 2.0, since
I don't have version 3.0 of C#), multicasting (and the syntax for it),
traversing an array of delegates. If anybody cares to comment, please
post how in version 3.0 you would declare a (anonymous) delegate
"inline" and 'inside' a class method (see comment below: "; //cannot
declare here! compiler errror, must be done outside of class method--
one disadvantage apparently of version 2.0" and, "//NOT ALLOWED! must
be outside of...")
You are confusing the concept of a delegate _type_ with that of a delegate
_instance_. You are not allowed to declare types within a method body,
and that includes delegate types. The compiler version isn't the issue
here; it's that you don't fully understand delegates.

As for specific comments regarding your example, I'll start by pointing
out that MSDN has a MUCH MUCH better article introducing delegate types:
http://msdn.microsoft.com/en-us/libr...59(VS.71).aspx

It's from an earlier version of C# so it's missing some specific language
features, but it does so much of a better job of describing how and why to
use delegates, that's not important. And the newer features are described
in more recent articles, again in a much clearer way.

Here are a handful of things that come to mind with respect to your
program:

-- Creating your own delegate types is pointless. Just use Func<int,
intinstead

-- If you decide you must create your own delegate type, give it a
useful name. You named "DelegateClass. PublicHigherPow er2" in a way that
implies a particular implementation for the delegate: taking the parameter
to the power of two. But of course, the actual delegate can do anything
that receives an int and returns an int (you even demonstrate that in your
code).

-- If you're going to try to write code examples for other people to
use, you need to pick a naming convention and stick with it. Using camel
case for some variable names, and then Pascal naming for others is just
going to distract the reader and make it difficult to see what the actual
point of the example is.

-- Don't name a variable with the word "class" (as in
"myDelegateClas s") unless that variable is actually going to reference an
instance of an actual _class_ (that is, something that inherits Type and
is an actual class type).

-- Don't write comments in broken or abbreviated English. Again, if
this is for someone else to read, you need to make it readable. Comments
like "!!! note: how called: UnAwareClass.Cu ber" are not descriptive or
informative. What is it that you really want the reader to note? In what
way is how "UnAwareClass.C uber" called interesting? That information
needs to be in the comment; you can't just assume that the reader will
figure it out.

-- The comment "apparently no ill effects if follows rather than
preceeds previous line" makes no sense whatsoever. Why _would_ there be
any "ill effects" from reordering the lines of code being described?

-- The comment "!!!Note significance: 'delegate' keyword NEVER
APPEARS in class UnAwareClass (!)" also makes no sense. Why would the
"delegate" keyword have to appear in a class that doesn't use any
delegates? I might as well add comments that also say "!!!Note
significance: 'switch' keyword NEVER APPEARS..." and "!!!Note
significance: 'foreach' keyword NEVER APPEARS..." (to name a couple of
other keywords that don't appear in that class).

-- The multicast examples are just silly. They fail to demonstrate
the real use of multicast delegates, which is to take advantage of the
built-in traversal of the invocation list. If all you're going to do when
traversing the list is to call each delegate instance individually, then
just call the original multicast delegate directly. Your second multicast
example doesn't even call anything, so it's even more pointless.

-- I find it inconsistent and pointless to use the Math.Pow() method
for your cube function, considering you just explicitly multiply for
squaring and the fourth power. The explicit multiplication is more
readable and in any case, if you're writing a code sample, stick to one
thing. At the very least, pick one or the other approach.

-- For that matter, the comments about "foreach" are also
superfluous. A code sample should demonstrate one thing and demonstrate
it well. If you want to use "foreach", that's fine, but don't waste time
trying to teach that. It's not the point of the code sample and it just
obfuscates the main point of the sample. Likewise the use of the
Math.Pow() method. If you're trying to demonstrate that there are
multiple ways to compute powers, well...don't. Put that in a different
code sample.

-- The comment "One advantage of delegates over Events is that a
delegate can return a value directly" is simply false. An event can use
any delegate type, including one that returns a value.

Other than those things, as well as the general sloppiness of the code and
comments, I'd say the sample is fine as far as it goes. I still prefer
the actual MSDN documentation though. The MSDN stuff seems to have been
written by people with some actual experience in teaching and
documentation, and who actually know the material they are trying to teach.

No doubt you'll take offense at this reply, but frankly I think it's
something you need to see. This isn't the first time you've posted code
purporting to educate others, when in fact the code is a fairly poor
example of using C# and/or .NET (refer to your previous "static
inheritance" stuff, for example). If ever the phrase "some kinds of help,
we all can do without" applied, it's here.

Pete
Jul 13 '08 #8
On Jul 13, 9:32*am, "Jon Skeet [C# MVP]" <sk...@pobox.co mwrote:
>
No, I don't believe that code would ever have worked. You can't
declare another type inside a method, which is what you were trying to
do.
OK, that puts my mind at ease. I guess maybe I was confused with the
"lambda" business or whatever small nuiance regarding delegates that
C# 3.0 has which C# 2.0 doesn't.
>
Be aware that there's a big difference between declaring a delegate
*type* and declaring a *variable* of a delegate type.
Right, got that. We're talking about declaring a delegate type.

RL
Jul 13 '08 #9
raylopez99 <ra********@yah oo.comwrote:
No, I don't believe that code would ever have worked. You can't
declare another type inside a method, which is what you were trying to
do.

OK, that puts my mind at ease. I guess maybe I was confused with the
"lambda" business or whatever small nuiance regarding delegates that
C# 3.0 has which C# 2.0 doesn't.
Lambdas are rather more than a "small nuance", and type inference
improvements in C# 3 are pretty important when it comes to generic
delegates, too.
Be aware that there's a big difference between declaring a delegate
*type* and declaring a *variable* of a delegate type.

Right, got that. We're talking about declaring a delegate type.
That's what the statement you've got there does, yes. But both
anonymous methods and lambda expressions are about creating *instances*
of delegates.

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jul 13 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3238
by: Phil G. | last post by:
I was recently struggling to adapt an example I have using delegate methods, IasynResult and AsynCallback. Doing a little research I came across an example, which in fact was being used to return data from an external sql database...exactly what I am doing. This example used the System.Threading namespace and thread.start etc What are the pro's and con's of using/choosing either option? They both 'appear' to create a process on a new...
12
206
by: tshad | last post by:
I have a set up javascript functions that pass function pointers and I am trying to figure out how to do the same thing in C# using delegates. // We define some simple functions here function add(x,y) {return x + y;} function subtract(x,y) {return x - 1; } function multiply(x,y) {return x * 1; }
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8245
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4877
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.