How can i send files and objects from client to server and vice versa.

64 views
Skip to first unread message

Максим Шокавин

unread,
Dec 5, 2014, 5:54:32 AM12/5/14
to jets...@googlegroups.com
At first, thanks you for your great library. 
I'm doing a card game, using your library and the question arose, how can I transfer objects, object Card for example.  NettyMessageBuffer protocol requires Transform class. How can I transfer files, pictures for example?

abraham menacherry

unread,
Dec 5, 2014, 9:35:38 AM12/5/14
to jets...@googlegroups.com
You can use nadron to send files and images. But that is not really what it is meant for. Nadron is a library, i.e. it is not a full stack web container. What it means is that it can be embedded in tomcat or any other application server. Use the tomcat for holding your client html, javascript, images ad other files etc. But for the websocket  or binary part of the game communication,  connect to nadron's port number(18080 by default) from the client instead of connecting to tomcat's port number.

To send objects you can use https://github.com/menacher/java-game-server/blob/netty4/nadron/src/main/java/io/nadron/protocols/impl/MsgPackProtocol.java protocol. MsgPack has libraries in multiple languages including java so you should use the same thing at client side also. I don't have a unit test for MsgPack but the one for AMF3 shows how you can send objects, decode encode etc.


Thanks,
Abraham.

On Fri, Dec 5, 2014 at 5:54 AM, Максим Шокавин <exelen...@gmail.com> wrote:
At first, thanks you for your great library. 
I'm doing a card game, using your library and the question arose, how can I transfer objects, object Card for example.  NettyMessageBuffer protocol requires Transform class. How can I transfer files, pictures for example?

--
You received this message because you are subscribed to the Google Groups "jetserver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jetserver+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages