Sending objects in messages

I’d like my server to send a few content items to the client before the game starts. However, I ran into this:

java.lang.IllegalArgumentException: message too long: 4195773 > 65535
at com.sun.sgs.impl.service.session.ClientSessionImpl.send(ClientSessionImpl.java:190)
at Aethyria.AePlayerConnection.sendMessage(AePlayerConnection.java:319)
at Aethyria.AePlayerConnection.sendAeWorldObject(AePlayerConnection.java:395)
at Aethyria.AePlayerConnection.sendNextObject(AePlayerConnection.java:406)
[etc]

Sure, I could break the data into 64k chunks, but wouldn’t it be handy if the framework helped out with that, a bit?

Is there a better toolbox mechanism, or do I really have to re-solve this problem?

Thanks!

That a HUGE object your sending… over 64K.

Having said that, Il a sk the folks working on the comm mananger about data size limits but I wouldn’t be surprised if you’ve hit a design limit.

What are you trying to send that is so big??

Content. In this particular instance, a heightmap image, although it could’ve been any of a number of content items.

Again, I can code around it – I was just surprized that this handy-dandy comm channel that SGS was giving me practically for free didn’t like my big data.

Thanks!

Well, what we do in MPK20 is send a URL to the clients and have them fetch the data over the web server.

An issue with pushing large data straight through an SGS pipe is that you can clog the pipes and hurt interactive performance, which is the primary goal of the system.

Web servers and streaming servers are designed for pushing large amounts of static data to users. We felt it better to use the right technology for the right problem then to try to build a “one size fits all” that did nothing extremely well.

See the thread on streaming for more info on streaming servers.

JK

Yeah, that’s the solution I “stumbled into” on my own.

Suggestion: add a note to that effect in the docs. In fact, a whole section on “how you n00bs might approach common problems”, with 1-3 sentence answers might be a good idea.

I already had a nice java-comm-channel library set up from a previous project, so getting around this was easy – but the whole “SGS gives you all of that stuff for free, hassle-free” made it a tempting thing to try :slight_smile:

Thanks!

Well, I’m trying to keep the FAQ update with this stuff. Your right that eventually the FAQ shoudl probably migrate into the main doc. :slight_smile:

Thank you. This is all helpful feedback. I’m going to pursue that size limit with the comm team just to see if its a side effect or a designed in limit. But in general for large downloads of static data it seems like there might be more targeted technologies already available.