PowerTCP Telnet for .NET

from $349.00
Available Platforms

See all PowerTCP Telnet for .NET Code Examples

 Receive and Display Data Example

The following example demonstrates receiving data and displaying it.


//Telnet.Read(buffer) performs a single socket read, blocking until at least one byte is read, up to as much data as is available on the socket or buffer.Length, whichever is lowest.
//This code will block until the connection is closed or Telnet.SocketOption.ReceiveTimeout has expired.

Telnet telnet1 = new Telnet();
telnet1.Login(new Credentials("myUsername", "myPassword", "$");
    byte[] buffer = new byte[1024];
    Data data = telnet1.Read(buffer);
    while (data != null)
        data = telnet1.Read(buffer);
catch(Exception ex)
    //handle exception as desired


To download a trial please visit the PowerTCP Telnet for .NET product page.