Description
The SetRelayServerData is tricky to use when you don't know it. Documentation will help but a better solution would be to split it in two functions : SetHostRelayServerData and SetClientRelayServerData
Why?
How it works : When you are a host, you are filling all the mandatory parameters and everything will work well (question remains for the isSecure flag at the end of the optional parameter that could be useful for the host). If you are a client, you need to fill the mandatory parameters with your own and the first optional parameter with the host data.
The problem is that the library will not output error if the client has not filled up the optional parameter. Instead, it will try to establish the relay connection but will end up in an obscure self connection error. But that is not the real error, the real error is you have forgotten to precise your hostConnectionData which are optional in the case you are a host but mandatory if you are a client.
** What would be the best? **
Two functions :
SetHostRelayData with all the mandatory parameters and the optional isSecure flag
SetClientRelayData with all the mandatory parameters for the client (so all for the host + the host connection data) and the optional isSecure flag.