More socket stuff. Your input is needed.

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
User avatar
Administrator
Site Admin
Posts: 4923
Joined: Sat Jan 05, 2008 4:21 pm

More socket stuff. Your input is needed.

#1 Post by Administrator » Fri Mar 20, 2015 10:35 am

Previously, all socket data was held in an alternate thread and only exposed to the Lua side through MicroMacro's event system. After rewriting a good portion of the code, this is no longer the case. Any data that a socket receives can be requested at any time in your scripts without causing any blocks, like so:

Code: Select all

-- This will display all information held in the socket's receive queue before moving forward
local data = socket:recv();
while( data ) do
  print("More data:", data);
  data = socket:recv();
end
The data will still also be available via the "socketreceived" event. As of right now, even if you use socket:recv() to grab and pop a message off its input queue, that same message will also be passed to macro.event() later as a socketreceived event, and vice-versa; the two do not modify each other. This also means that any data not popped off the queue will still remain in it until popped off, and not be automatically flushed each logic frame. This is where your input comes in.

Should already-read messages (popped off the queue from socket:recv()) still be passed as an event?
Should the socket:recv() queue be flushed every logic cycle? (Note: any unhandled messages would be flushed *after* the events)
Is there any other functionality needed?

User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: More socket stuff. Your input is needed.

#2 Post by beanybabe » Tue Jul 14, 2015 10:27 am

Its like your talking in a foreign language.

I get the jist, it seems you working on network data. I wanted to drop a couple coins on that topic. I feel it may be a bad idea. Imagine someone putting data transfer code in a wp and copying your password or document folders on your pc.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest