By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,554 Members | 1,576 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,554 IT Pros & Developers. It's quick & easy.

Avoiding Implicid Conversion?

P: n/a
I am using a threadpool to process UDP broadcast messages. I cant figure
out how to type the threadpool call back. Below is a snip of my code. The
"process_UDP_Message" needs to pass a byte array .... but the Call Back
only passes back a generic object. Anyone know how I can force the type of
"receiveBuffer" when I make the call to process_UDP_Message?
'Main processing loop:
If Not ThreadPool.QueueUserWorkItem _
(New WaitCallback(AddressOf process_UDP_Message_deligate),
ExactBufferSize) Then
Debug.WriteLine("Could not queue to thread pool.")
End If
Private Sub process_UDP_Message_deligate(ByVal RecieveBuffer As Object)
'We are "late binding" & converting the object back to a byte array.
Not sure
'What the performance of this is?
process_UDP_Message(RecieveBuffer)
End Sub
Private Sub process_UDP_Message(ByVal RecieveBuffer() As Byte)
'Process Message
Feb 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> process_UDP_Message(RecieveBuffer)

process_UDP_Message(CType(RecieveBuffer, Byte()))
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 16 '06 #2

P: n/a
thanks!

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ur**************@TK2MSFTNGP15.phx.gbl...
process_UDP_Message(RecieveBuffer)


process_UDP_Message(CType(RecieveBuffer, Byte()))
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Feb 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.