Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How to pass large string between a server sketch and a client sketch?

$
0
0

Hi guys,

I'm trying to send a large json from a client to a server. The JSON is a 64x64 matrix where each cell has a RGB color. So it is basically a string of 24000+ characters including the separators.

Everything works fine if I keep the string lenght under 8000 characters (8 bit color), but when trying to pass to large one I only get partial data.

Here's a code sample of my draw()

void draw () {

  client = server.available();

  if ( client != null) {

      data = client.readString();

      if (data != null) {

        println (data);
        //json = new JSONData(data);

        //if (json.command != null)
        //  commandMap.get(json.command).execute();

        data = null;
      }
    }
  }

  // Some code
}

Is there something wrong with it? I'm quite a newbie with the client-server concept.

Thanks


Viewing all articles
Browse latest Browse all 2896

Trending Articles