What uses bandwidth specifically?
Options
Hi there,
I'm a little confused as to what uses bandwidth specifically. For example, please have a look at the code below:
I'm a little confused as to what uses bandwidth specifically. For example, please have a look at the code below:
void Start() { photonView.RPC("RPCFunction", PhotonTargets.All, SomeString, SomeInt); } [PunRPC] void RPCFunction(string SomeString, int SomeInt) { // do something with the string // do something with the int }Am I using bandwidth only when I call the RPC and when I pass the string and the int? Or am I also using bandwidth with the functionality inside RPCFunction(). For example would it be better if inside RPCFunction() I just had another function being called say Function() and I moved everything there kind of like the following or does it make no difference?
[PunRPC] void RPCFunction(string SomeString, int SomeInt) { Function(SomeString, SomeInt); } void Function(string SomeString, int SomeInt) { // do something with the string // do something with the int }Thanks in advance!
0
Best Answers
-
My understanding is bandwidth is the size of the data sent over the network. How you split up your functions shouldn't matter since once the RPCFunction is called, the data has already arrived at the client.6
-
Hi @stefanplc,
@CWright is right on this. When you call RPC(...) the submitted data is prepared and awaits its dispatching. Up to this point there is no network communication, means that this doesn't consume any bandwidth. When the data finally gets dispatched, this a network call and the client is sending data to the server. It also doesn't matter, how many sub-function calls you have inside the [PunRPC] function which gets called on data arrival.5 -
Yes, you are correct.5
Answers
-
My understanding is bandwidth is the size of the data sent over the network. How you split up your functions shouldn't matter since once the RPCFunction is called, the data has already arrived at the client.6
-
Hi @stefanplc,
@CWright is right on this. When you call RPC(...) the submitted data is prepared and awaits its dispatching. Up to this point there is no network communication, means that this doesn't consume any bandwidth. When the data finally gets dispatched, this a network call and the client is sending data to the server. It also doesn't matter, how many sub-function calls you have inside the [PunRPC] function which gets called on data arrival.5 -
So the inside of the RPCFunction doesn't really matter then correct? I'm only being charged for sending the RPC and whatever variables I pass along like ints and strings and so forth, right?0
-
Yes, you are correct.5
-
Thanks!0