Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

What way is better to handledata subs(to consume less network)?


DshWinchester
 Share

Recommended Posts

Hi guys,I was wondering wich way is better to consume less network with handledata subs

I will give a example; TRADE SYSTEM(request,accept,decline)

way 1:

Make one packet for each of them

example:

> sub handleRequest
>
> request
>
> end sub
>
> sub handleaccept
>
> accept
>
> end sub
>
> etc..

Way 2:

making only one causing them to be divided by a variable

example:

> select case Variable
>
> case 1
>
> request stuff
>
> case 2
>
> accept stuff
>
> case 3
>
> decline stuff
>
> end select

thanks
Link to comment
Share on other sites

Second is better, its like asking: "Will 3 eggs be more expensive than one?" ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

I'll explain why it's better:

First option sends 2 packets, with almost no extra client work.

Second option sends 1 packet, but the client has to do some extra work (the Select Case's), but the user won't notice because that's done pretty fast.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...