Newlisp telnet

Started by dexter, October 09, 2013, 01:26:39 AM

Previous topic - Next topic

dexter

I know newlisp -p 1234 can be a telnet server



But How can I write a code to be a telnet server in newlisp??



I mean like



(set 'listen (net-listen 8086))

(unless (not (nil? listen))
(begin
(print "listening 8086 failedn")
(abort)
(exit)
)
)
(print "Waiting for connection on: 8086 n")

(unless (= (share talk) 20)
(set 'connection (net-accept listen))
(while (not (net-select connection "r" 1000)))

(while (net-select connection "w" 1000)
(if (setq rvlen (net-receive connection buff 128 "n"))
(begin
(println buff)
;;???
)
)
)
(assert "close connect  n")
(net-close connection)
)


Telnet can connect to my code on 8086, I can receive the input data from telnet

But It is not like" newlisp -p 1234"s effect, "newlisp -p 1234" more like a real terminal.



I searched forum, seems no answer for me.



Anyone help me a little?

Do I need to net-send back some  particularly data so can make it like a real terminal?

conan

#1
What do you mean by "real terminal"? To have line editing capability?

dexter

#2
Thanks for the reply



No edit

just looks like a terminal



I did it yestoday, Telnet can work with my code now



Now hypertrm on windows ,still can not work correcttly with my code