Re: Telnet help
- Posted by irv Feb 25, 2018
- 1311 views
Thanks! Your code works (with a minor modification). I must have tried every possible way to use sockets except the right one!
include std/socket.e include std/console.e integer deg = 90 object msg = sprintf("set /autopilot/settings/heading-bug-deg %d\r\n",deg) sockets:socket sock = sockets:create(sockets:AF_INET, sockets:SOCK_STREAM, 0) if sockets:connect(sock, "127.0.0.1:5401") = 0 then if sockets:send(sock,msg, 0) != length(msg) then display("ERROR\n") else display(sockets:receive(sock,0)) -- view confirmation msg; end if sockets:close(sock) end if