Jump to content




Trying to program an FTP

computer wireless help

  • You cannot reply to this topic
2 replies to this topic

#1 OrangeC7

  • Members
  • 9 posts

Posted 14 January 2018 - 07:27 PM

(I'm reposting this because I didn't know about the "code" and "spoiler" tags, sorry. I'll be more careful next time.)
I've been troubleshooting my FTP_RECEIVER and FTP_SENDER programs for a while, but I'm stuck on a bug that keeps freezing the computer on the initialisation stage. Any help is appreciated, whether it's just to say I have the wrong approach, or if it's a solution to my problem. I'm kind of a beginner to this, although I have some coding experience in other languages including this one.
I start FTP_RECEIVER first, because then it will continue waiting for the next computer, FTP_SENDER to respond. The code is below

FTP_RECEIVER:
Spoiler

FTP_SENDER:
Spoiler

Thank you for reading, and for your patience.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 15 January 2018 - 12:59 AM

View PostOrangeC7, on 14 January 2018 - 07:27 PM, said:

I'm stuck on a bug that keeps freezing the computer on the initialisation stage.

Which script are you talking about? Which block of code within that script?

Taking a quick glance through, your receiver script has a problem in that it makes use of textutils.slowPrint(). This function starts timers, and then continuously pulls events from the front of the event queue until it finds the one it wants. Rednet messages are also "received" via the event queue, but if any are in there while slowPrint is executing, they'll be pulled and discarded: rednet.receive() won't be able to find them later.

#3 OrangeC7

  • Members
  • 9 posts

Posted 15 January 2018 - 01:58 AM

View PostBomb Bloke, on 15 January 2018 - 12:59 AM, said:

Which script are you talking about? Which block of code within that script?


I have no idea what is going wrong, all I know is that both computers output the message that indicates they have done the "initialisation" step, and then never output anything again. I'll try to take your suggestion into consideration, though. The main reason I have all the confirmation messages is because of the slowPrint, both computers keep trying to establish contact, in case the other one missed something. If it means sacrificing good looks for functionality, I'll gladly remove the slowPrint feature and use a regular print. Thank you for replying, though! I appreciate it. =)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users