ID:151553
 
I am wondering which would be more effective in conserving network bandwidth:
A: Having buttons on the interface that do not call verbs each time they are clicked, and the data they store is only accessed using winget() when it is needed.
B: Having buttons on the interface that have a verb called each time they are clicked, which updates a variable that is used for storing their data.

In option A, someone could spam click the buttons all they wanted and it would use no traffic at all, until they did something that used those interface options.

In option B, each time someone clicked an interface button it would send a message to the server (they used a verb) but when the time came to use the variable in question it would only need to check a variable instead of using winget().

Now, assuming I don't care about the delay in the action (using winget() makes it wait until the client sends over the data you asked for, whereas the variable would have no delay at all) then which one would keep network traffic down more in a NORMAL environment? Obviously someone spam clicking the verbs is going to use more network traffic, but that isn't really what I would consider a 'normal' situation.

Basically the deciding factor here would be how network intensive is winget VS simply using a verb?
(Week old bump with content.)

.winset "blah=blah" never goes to the server in the first place so no traffic would be used.

Option A would use less(see: no) traffic, though you're also risking them modifying things using it. If you can trust people go ahead. :)
(Even control_freak cannot control memory editors.)

Option B is more secure, but uses more traffic because it does go to the server.
In response to Leur (#1)
WinGET not WinSET

:)

Thank you for the info though.
In response to AJX (#2)
oh, then -shrugs- I don't understand what's going on behind that delay for winget so I can't help ya.
The problem with your first option is that you can't access the precise time when a button or some other interface object is clicked or interacted with.

Additionally, if your interface is complex, you may end up doing hundreds of winget() and winset() calls everytime you're trying to update or retrieve data (maybe a dozen or two per player?).

I'm not entirely sure on the statistics for network latency for one or the other. Currently don't have any ideas on how to go about measuring this.
In response to D4RK3 54B3R (#4)
D4RK3 54B3R wrote:
The problem with your first option is that you can't access the precise time when a button or some other interface object is clicked or interacted with.

Indeed, but if it isn't a high-priority action/response then the delay is irrelevant.

Additionally, if your interface is complex, you may end up doing hundreds of winget() and winset() calls everytime you're trying to update or retrieve data (maybe a dozen or two per player?).

True, but on that same note you will end up with the same hundreds of verb calls instead of the wingets.

I'm not entirely sure on the statistics for network latency for one or the other. Currently don't have any ideas on how to go about measuring this.

Me neither, hence the problem. :(

I'ma probably try to grab a network traffic analyzer and see which one sends larger packets. Delving into a realm I have not before ventured though. We'll see how it turns out.
One question here is how often you would need to use winget(). If you want to be able to monitor changes as soon as they're made, a verb for the button is really your best option. Otherwise you'd have to use winget() to poll the client constantly, and polling is almost never a good option.

If however you're using a form that can have all kinds of changes made and then have the user click OK to confirm it's now time to call winget(), then you'd only be calling winget() once. In that case I think winget() will serve you better than verbs because you can get more information all at once with the * syntax, and that info may even be in a zipped form if the message is big enough.

Lummox JR
In response to Lummox JR (#6)
Lummox JR wrote:
Lummox JR

^.^

Thanks Lummox.