mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 03:11:08 +01:00
Merge pull request #2588 from kfeuz/Issue2364
Implements the active() method for Serial and Server (Issue #2364).
This commit is contained in:
@@ -177,6 +177,13 @@ public class Server implements Runnable {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this server is still active and hasn't run
|
||||
* into any trouble.
|
||||
*/
|
||||
public boolean active() {
|
||||
return (thread != null);
|
||||
}
|
||||
|
||||
static public String ip() {
|
||||
try {
|
||||
|
||||
@@ -135,6 +135,15 @@ public class Serial implements SerialPortEventListener {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this port is still active and hasn't run
|
||||
* into any trouble.
|
||||
*/
|
||||
public boolean active() {
|
||||
return (port.isOpened());
|
||||
}
|
||||
|
||||
|
||||
public void pre() {
|
||||
if (serialAvailableMethod != null && invokeSerialAvailable) {
|
||||
invokeSerialAvailable = false;
|
||||
|
||||
Reference in New Issue
Block a user