Skip to content

Commit 21e4f3e

Browse files
committed
new build
1 parent 06dd347 commit 21e4f3e

23 files changed

+24
-4716
lines changed
-144 Bytes
Binary file not shown.

eclipse-workspace/oscP5/processing-library-template-master/src/netP5/UdpServer.java

+14-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ public UdpServer( final String theHost , final int thePort , final int theDatagr
6363
server = new InternalServer( theHost , thePort , theDatagramSize );
6464
}
6565

66-
//public boolean isRunning(){
67-
// return server.thread.isAlive();
68-
//}
66+
public boolean isRunning(){
67+
if(server != null){
68+
return server.isRunning();
69+
}
70+
return false;
71+
}
72+
6973

7074
public boolean close( ) {
7175
try {
@@ -125,6 +129,13 @@ class InternalServer implements Runnable {
125129
thread.start( );
126130
}
127131

132+
public boolean isRunning(){
133+
if( thread != null ){
134+
return thread.isAlive();
135+
}
136+
return false;
137+
}
138+
128139
public void run( ) {
129140

130141
/* Create a selector to multiplex client connections. */

eclipse-workspace/oscP5/processing-library-template-master/src/oscP5/OscP5.java

+10
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public class OscP5 implements Observer {
108108
private Transmitter transmit;
109109
private Object parent;
110110

111+
UdpServer udpServerInstance;
112+
111113
/**
112114
* default constructor, starts an UDP server with maximum packet size of 1536 bytes.
113115
*/
@@ -161,6 +163,7 @@ private void init( Object theParent , OscProperties theProperties ) {
161163
} else {
162164
UdpServer udpserver = NetP5.createUdpServer( _myOscProperties.host( ) , _myOscProperties.listeningPort( ) , _myOscProperties.datagramSize( ) );
163165
udpserver.addObserver( this );
166+
udpServerInstance = udpserver;
164167
transmit = udpserver;
165168
}
166169
break;
@@ -185,6 +188,13 @@ private void init( Object theParent , OscProperties theProperties ) {
185188

186189
}
187190

191+
public boolean isServerRunning(){
192+
if(udpServerInstance != null){
193+
return udpServerInstance.isRunning();
194+
}
195+
return false;
196+
}
197+
188198
public void update( Observable ob , Object map ) {
189199
/* gets called when an OSC packet was received, a Map is expected as second argument. */
190200
process( map );

0 commit comments

Comments
 (0)