What is the recommended way to pass data back and forth between two threads using C#
        Posted  
        
            by kenalex
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by kenalex
        
        
        
        Published on 2010-03-08T20:41:14Z
        Indexed on 
            2010/03/08
            20:51 UTC
        
        
        Read the original article
        Hit count: 348
        
c#
I am trying to make an app that will pass data between two servers Connection1 and Conenction2 using sockets.What i would like to do is receive data from Connection1 and pass it to Connection2 and vice-versa.Connection1 and Conenction2 are on different threads. What is the best way to call methods on different threads in order to pass data back and forth between them.Both threads will use the same message object type to communicate in both directions between them.
Thanks
© Stack Overflow or respective owner