Login  
Search All Forums
Dart Home | PowerTCP Telnet for .NET | Custom Development Reply | PowerTCP Telnet for .NET Topics | Forums   
AuthorForum: PowerTCP Telnet for .NET
Topic: Could not execute Rexec.ReadToEnd()
oswaldlily

From: India
Posts: 6
Member Since: 06/24/15
posted June 24, 2015 7:53 AM

Rexec.ReadToEnd() strucks in C#. What could be the possible reasons?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted June 24, 2015 10:01 AM

Hello,

Can you expand on what you mean by 'strucks'? What is the behavior you're observing, and what behavior are you expecting?

Is the connection being closed? This method only returns once the connection is closed, or an exception (other than a timeout) is thrown.
oswaldlily

From: India
Posts: 6
Member Since: 06/24/15
posted June 25, 2015 3:52 AM

Using dart.telnet connecting to unix server .breakpoint stopped in readtoend

Rexec.connect(session);
Rexex.execute(username,pwd,command string);
Rexec.marshal(rexec.readtoend(),null,nul)
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted June 25, 2015 9:12 AM

Is the connection being closed? This method only returns once the connection is closed, or an exception (other than a timeout) is thrown.
oswaldlily

From: India
Posts: 6
Member Since: 06/24/15
posted June 25, 2015 9:48 AM

If I close the connection how I ll read???
Rexec.close();
Rexec.Marshal (rexec.readtoend(),null,null)
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted June 25, 2015 12:15 PM

ReadToEnd() is designed for when the other side closes the connection after sending all data. If your server is not closing the connection, you might consider using one of the other Read methods: ReadToDelimiter, ReadToCount or the basic Read method (note that the basic Read method is not guaranteed to receive complete messages; multiple Read() operations may be required to receive all expected data (to construct the complete message, concatenate the data returned by each Read operation)).
oswaldlily

From: India
Posts: 6
Member Since: 06/24/15
posted June 26, 2015 3:24 AM

What is the command prompt for readtodelimiter
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted June 26, 2015 8:47 AM

I'm sorry, I don't understand your question. ReadToDelimiter() takes a parameter named 'delimiter', which is the character or characters that indicate the end of the data desired. ReadToDelimiter can be used to read the data your server has sent until a command prompt; is that what you're asking?

The command prompt referred to in other places in our documentation are the characters used to denote that the server is waiting for user input, such as '~$', or in the Windows command console 'C:\Users\Username>'. This is dependent upon your server, so I would not be able to tell you what you should use.
Reply | PowerTCP Telnet for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX