Create a new class. The class will contain the reader thread. You could
also create the writer thread in the class or create another class that
contains the writer thread. Then:
1) Create the socket and get the ref.
2) Create the reader (and writer) class instances, pass in the ref to the
socket during construction of the class.
3) Now the class (or classes) have the ref to the socket. Store that in a
private field of the class.
4) Make a Start() method on the class. This method will start the thread
and use a private method for the start delegate. This method will have
access to the private socket ref. Now you have access to the socket. Other
classes could get access the same way. Does that make sense? hth
--
William Stacey, MVP
cSharpDotNet said:
The problem is that a method used for threading does not allow for
parameters to be passed to it. Is there a way around this? I would really
like to be listening for UDP in one thread and sending UDP in another.Community Website:
http://www.dotnetjunkies.com/newsgroups/