You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Execute the simple_server.
Execute the simple_client.
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
The text was updated successfully, but these errors were encountered:
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
@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.
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?
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
Your Environment
Possible Causes / Solutions
The text was updated successfully, but these errors were encountered: