Forum Discussion

rbhogavalli's avatar
rbhogavalli
Occasional Contributor
11 years ago

How to access GetStream method in System_Net_Sockets.TCPClient (.net Class)

I am able to access the constructors related to System_Net_Sockets.TCPClient  but not able to use the methods for the same.



Could you please let me give an example to access this method in testcomplete.

2 Replies

  • First, you need to create a TcpClient object using one of the constructors. Then you can call the methods of the created object:



    function Test()

    {

      var oTcpClient = dotNET.System_Net_Sockets.TcpClient.zctor_2();

      oTcpClient.Connect_4("www.example.com", 11002); // connect to hostname and port

      var oStream = oTcpClient.GetStream();



      // ...

    }

  • rbhogavalli's avatar
    rbhogavalli
    Occasional Contributor
    I am able to figure it out but thanks for the fast response. Got confidence that I can relay on the testcomplete community :)