Page 1 of 1

Question about send() and sendExtensionResponse()

Posted: 03 Apr 2019, 11:37
by coolboy714cp
Hello everyone, I was just in the middle of coding and noticed that there are two different methods that can be used to send a response back to the client after you first send an extension request.

You can use simply send():

Code: Select all

send(responseCmd, response, responseUser);
And then you can also use getApi().sendExtensionResponse():

Code: Select all

getApi().sendExtensionResponse(responseCmd, response, responseUser, responseRoom, responseUDP);
Why are there two different methods that can do the same thing? Or am I wrong here and they have two different purposes? (Now thinking about it, I believe send() is for things like servlets maybe, but I'm not 100% sure.)

So when should each one of those methods be used?

Thanks for any help and advice!
-Carson Bennett

Re: Question about send() and sendExtensionResponse()

Posted: 03 Apr 2019, 13:49
by Lapo
Hi,
one is the short version of the longer one, a common practice in Java or any other language that supports method overloading.

The responseRoom parameter is necessary when you're replying from a Room Extension and you need the client to be able to identify which Room is the response coming from.

The last parameter is set to false by default but you can pass it if you want the response to be sent by UDP.

Cheers