Guest cgchris99 Posted August 15, 2002 Posted August 15, 2002 I am working with tcpClients with 2 connections and have the following NetworkStream1 = tcpClient1.GetStream NetworkStream2 = tcpClient2.Getstream How do I assign NS to point to NetworkStream1 or NetworkStream2 depending on the parameters passed to the sub routine. For example Public Sub ReadCameraData(ByVal CamNum) Dim NS as NetworkStream If CamNum=1 then If CamNum =2 then End Sub I just want to make sure when I call NS.DataAvailable() is the same as calling NetworkStream1.DataAvailable() Another example would be variable XYZ and VarA and VarB. Conditionally point XYZ at VarA. When you Change value of XYZ to 91838 and then check the value of VarA it too would be 91838. Thanks for any advice Quote
*Gurus* divil Posted August 15, 2002 *Gurus* Posted August 15, 2002 Dim NS as NetworkStream If CamNum=1 then NS = tcpClient1.GetStream If CamNum =2 then NS = tcpClient2.GetStream End Sub Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Guest cgchris99 Posted August 15, 2002 Posted August 15, 2002 I could be mistaken. but this Creates a copy of NetworkStream1. Changes made to NS will not actually effect NetworkStream1? Am I wrong? Thanks Quote
Guest cgchris99 Posted August 15, 2002 Posted August 15, 2002 Sorry, I should have read your post more closely. I will try this. thanks Quote
*Gurus* divil Posted August 15, 2002 *Gurus* Posted August 15, 2002 A NetworkStream inherits from MarshallByRefObject, so yes, you're wrong. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.