Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network library examples work in 3.4, but broken in Processing 3.5.4/4.0a3 #6166

Open
KouichiMatsuda opened this issue Mar 8, 2021 · 3 comments
Labels
help wanted We have very little time and would like some help

Comments

@KouichiMatsuda
Copy link

KouichiMatsuda commented Mar 8, 2021

Description

I wrote the following simple_server.pde and simple_client.pde using "processing.net.*;" but their behaviors seem to be strange.
The simple_client.pde seems to receive "Hi" and "Yes".
Am I missing something?

// simple_server
import processing.net.*;
Server svr;

void setup() {
  svr = new Server(this, 5555); 
  size(450, 255);
}

void draw() {
  Client c = svr.available();
  if (c != null) { 
    String s = c.readString(); // 読み込む
    println(s);
    svr.write("Yes");
  }
}
// simple_client
import processing.net.*; 
Client c; 

void setup() { 
  c = new Client(this,"127.0.0.1", 5555);
  size(450, 255);
} 

void draw() {
  if (c.available() > 0){
    String s = c.readString(); 
    println(s);
  }
}

void mouseClicked() {
  c.write("Hi"); 
}

Expected Behavior

"Hi" should be displayed in the console of the simple_server and "Yes" should be in the console of the simple_client.
Processing 3.4 has this behavior but Processing 3.5 (4.0a3) doesn't.

Current Behavior

Both "Hi" and "Yes" are displayed in the console of the simple_client.

Steps to Reproduce

  1. Execute the simple_server.
  2. Execute the simple_client.
  3. Click the simple_clinet window.

Your Environment

  • Processing version: Processing 3.5.4 (4.0a3)
  • Operating System and OS version: Windows 10 Pro, version 2004, build, 19041.804
  • Other information: Processing 3.4 seems to behave as expected.

Possible Causes / Solutions

@knupel
Copy link

knupel commented Mar 28, 2021

If the bug concern Processing 4, may be it's better to on it https://github.com/processing/processing4

@benfry benfry added the help wanted We have very little time and would like some help label Jun 15, 2021
@benfry benfry changed the title Strange behaviors of network programs in Processing 3.5.4 (4.0a3). Network library examples work in 3.4, but broken in Processing 3.5.4/4.0a3 Jun 15, 2021
@benfry
Copy link
Contributor

benfry commented Jun 15, 2021

@StanLepunK Not unless it's specific to 4.x. If a bug reported here gets fixed, it'll be moved to that repository, but please don't post in both repositories. It's just me managing both of them, and it just makes more work.

@Nilmohon
Copy link

I want to work in this issue please assign me and tell which things to learn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We have very little time and would like some help
Projects
None yet
Development

No branches or pull requests

4 participants