how to start and close telnet sessions
MorgoZ
Posts: 116
Hello,
how can i close a telnet session from Netlinx?
I know that just sending a "send_string" to a serial port with a device with a telnet session on it will send the data to that device (if the serial parameters are well configured).
But i need to start a telnet session, send something, and the close it to be able to later start a new session with a different user, for example. How could i implement that? Something like "ip_client_open" and "ip_client_close".
Thank you!
how can i close a telnet session from Netlinx?
I know that just sending a "send_string" to a serial port with a device with a telnet session on it will send the data to that device (if the serial parameters are well configured).
But i need to start a telnet session, send something, and the close it to be able to later start a new session with a different user, for example. How could i implement that? Something like "ip_client_open" and "ip_client_close".
Thank you!
0
Comments
They way i done it, i open a telnet socket, send my command wait a time then i close it. it's very basic and it working great.
Yeah, I think Raphayo is confusing "telnet" with a TCP connection. His example is actually implementing HTTP. Telnet is different animal.
Yes your right it was not a telnet connection it was an http get command on a specific port. But using that kind of logic will give you the abilities to control your device thru telnet.
thanks for the answers, but in my post i was refering to a "serail port" connection, so no TCP socket connection is available (can't use ip_client_open / close).
Well, if it's just an rs232 connection, it's just simply mimicking whatever you do with a terminal session with a computer. Most times you have to send a CR/LF to wake the connection up. Then build a call/response routine to get through the login phase. You'll also have to figure out what character the terminal uses for a cursor and watch for that as well. A lot depends upon the behavior of the device..