Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
550 B
2
Indexable
Never
function connectTelnet()
    telnetSocket = TcpSocket.New()
    telnetSocket.OnConnect = function(socket, success)
        if success then
            print("Connection established.")
            sendAuthentication()
        else
            print("Failed to connect.")
        end
    end
    telnetSocket.OnError = function(socket, error)
        print("Socket error: " .. error)
    end
    telnetSocket.Data = function(socket, data)
        print("Data received: " .. data)
    end
    telnetSocket:Connect(ipAddress, port)
end
Leave a Comment