Docs to build IoBuffer byte[] to send message via SendUpdatePeersNotification?

0 votes
Hi,

When reading extends class of BaseRoomAdaptor, i see server can notification client via SendUpdatePeersNotification but i do not know how to contruct IoBuffer and build message. Is there any where to get the docs?

And i see server can notification client via SendChatNotification, can you explain when to use SendChatNotification and SendUpdatePeersNotification, performance ....

Thank so much!
asked Oct 22, 2014 in AppWarpS2 by tappygame (30 points)

1 Answer

0 votes
 
Best answer
Hi,
 
You don't have to deal with IoBuffer. It is used internally by AppWarp S2. The correct declaration of SendUpdatePeersNotification is as follows : 
 
public void SendUpdatePeersNotification(byte[] update, boolean isUDP);
 
You can create a byte array and send it to a user via this method. isUDP represents whether you want to send that message using UDP or Not. 
 
SendChatNotification can be used to send string messages where as SendUpdatePeersNotification is meant for sending binary messages. SendUpdatePeersNotification can be used to send messages over UDP or TCP. SendChatNotification only supports TCP.
 
Thanks
answered Oct 22, 2014 by Suyash Mohan (900 points)
selected Oct 22, 2014 by tappygame
Ah OK, I can implement it now! Thank so much!

By the way, there is a typo missing in http://appwarps2.shephertz.com/dev-center/api-guide/corona-client-listener/

onUpdatePeersReceived not onUpdatePeersReceieved
Thanks for the information :) We will update the documentation.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...