asynchron serversocket

  • Thread starter Thread starter Peter Schumacher
  • Start date Start date
P

Peter Schumacher

Hello,

first, I'm sorry, my english is terrible!

But in german newsgroups I didn't found an answer.

I found a sourcecode in VStudio-Help. "example for asynchronious
serversocket"
(ms-help://MS.VSCC/MS.MSDNVS.1031/cpguide/html/cpconnon-blockingserversocketexample.htm)
This is a link in the german help!

In this class are all functions SHARED (VB) or (STATIC) in C#.

But why? I need to use InstanceEvents. It works without the
SHARED-Keyword. Why are these functions SHARED?

Who can help me?

Thanks.


Peter
 
Peter said:
first, I'm sorry, my english is terrible!

No problem.
But in german newsgroups I didn't found an answer.

I found a sourcecode in VStudio-Help. "example for asynchronious
serversocket"
(ms-help://MS.VSCC/MS.MSDNVS.1031/cpguide/html/cpconnon-blockingserversocket
example.htm)
This is a link in the german help!

I'm afraid I cannot find that example in the English version of MSDN, could
you post the name of the .cs file so I can search the SDK samples?
In this class are all functions SHARED (VB) or (STATIC) in C#.

But why? I need to use InstanceEvents. It works without the
SHARED-Keyword. Why are these functions SHARED?

I suspect that its just convenience that they have used static methods. For
example if you do this:

class App
{
delegate void Del();
static void CallBack()
{
}
static void Main()
{
Del del = new Del(Callback);
del();
}
}

In this case CallBack has to be static because there is no instance! You can
easily do the following:

class App
{
delegate void Del();
void CallBack()
{
}
static void Main()
{
App app = new App();
Del del = new Del(app.Callback);
del();
}
}

Richard
 
Back
Top