|
-
Aug 17th, 2003, 08:48 PM
#1
Thread Starter
Hyperactive Member
What's the difference?
Dealing with Asyncronous Sockets, I am wondering what the difference between these 2 calls are..
Code:
Handler.BeginReceive(State.RBuff, 0, State.PacketSize, SocketFlags.None, New AsyncCallback(AddressOf ReceiveLock), State)
And this one?
Code:
Handler.BeginReceive(State.RBuff, 0, State.PacketSize, SocketFlags.None, AddressOf ReceiveLock, State)
They are both Asyncronous calls, I see some examples that use the "New AsyncCallback(AddressOf Method)" and some I just see "AddressOf Method", Is there any signifigant different? I tried both ways and they both seem to operate the same..
Just wondering
-
Aug 18th, 2003, 12:57 AM
#2
Frenzied Member
They are not different i guess. They are two ways of declaring delegates.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Aug 18th, 2003, 01:13 AM
#3
Frenzied Member
Re: What's the difference?
Originally posted by Hinder
Dealing with Asyncronous Sockets, I am wondering what the difference between these 2 calls are..
Code:
Handler.BeginReceive(State.RBuff, 0, State.PacketSize, SocketFlags.None, New AsyncCallback(AddressOf ReceiveLock), State)
And this one?
Code:
Handler.BeginReceive(State.RBuff, 0, State.PacketSize, SocketFlags.None, AddressOf ReceiveLock, State)
They are both Asyncronous calls, I see some examples that use the "New AsyncCallback(AddressOf Method)" and some I just see "AddressOf Method", Is there any signifigant different? I tried both ways and they both seem to operate the same..
Just wondering
The only difference is the ReceiveLock variable is being declared in the method call in the first. In the second its already declared so they just pass it in.
-
Aug 18th, 2003, 01:27 AM
#4
Thread Starter
Hyperactive Member
Re: Re: What's the difference?
Originally posted by DevGrp
The only difference is the ReceiveLock variable is being declared in the method call in the first. In the second its already declared so they just pass it in.
Hmm so let me get this straight then, The first one actually creates and uses it's OWN copy of the method ReceiveLock and runs it in its own space? The second one uses the "real" address of the method in the source? So the second one is like calling a Shared method then right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|