Jump to content




[solved] os.pullEvent not stopping program


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

#1 CreeperGoBoom

  • Members
  • 91 posts

Posted 30 May 2014 - 11:57 PM

take a look at:
http://pastebin.com/qufnLXtb

from line 148 to 181

maybe ive got the wrong understanding, but isn't os.pullEvent supposed to make the computer WAIT for an event? in my case "modem_message"

its getting to registering new command print then completely bypassing the os.pullEvent("modem_message") section, which is a critical part of function config

at the moment i don't have the server pc set up yet but I do have a response program ready to fire, i want the client to wait until I fire my response at it from the server pc

I must be missing something

edit: ill rephrase, server isn't coded fully but there's a response program on the server pc :D

Edited by CreeperGoBoom, 31 May 2014 - 09:33 AM.


#2 Bomb Bloke

    Hobbyist Coder

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

Posted 31 May 2014 - 05:51 AM

View PostCreeperGoBoom, on 30 May 2014 - 11:57 PM, said:

maybe ive got the wrong understanding, but isn't os.pullEvent supposed to make the computer WAIT for an event? in my case "modem_message"

Sort of.

Loosely put, each system has an event queue, and events go in there over time. os.pullEvent() grabs whatever event is at the front of the queue and hands it to you.

Adding a filter makes it discard any events it finds until it gets the type specified, but it still otherwise acts the same way - if there's already an event in the queue of the requested type, then it returns it pretty much instantly. It doesn't discard it and wait for a new event of that type to occur.

Anyway, I reckon your issue here is that you're looking for the reply in "m", whereas you should be checking against "f".

#3 CreeperGoBoom

  • Members
  • 91 posts

Posted 31 May 2014 - 08:59 AM

edit: found out what it was, i had a piece of code on server which was literally bouncing the message right back at the client, hence my os.pullevent issue [solved]

thanks for the help bomb bloke :)

code updated fyi

Edited by CreeperGoBoom, 31 May 2014 - 09:35 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users