We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I have been trying to run my old code on new version of processing 2.x and it reported me an error "cannot find a class or type name of "connectException" so I tried running the same code on processing 1.5.1 and it worked like charm without throwing any error.
Code:
void setup() {
size(600, 400);
ThinkGearSocket neuroSocket = new ThinkGearSocket(this);
try {
neuroSocket.start();
}
catch (ConnectException e) {
//println("Is ThinkGear running??");
}
smooth();
}
Please help.
I have tried importing this but it didn't work.
import java.util.*;
Do I have to import any thing else ?
Answers
Are we supposed to know what is a ThinkGearSocket??? :-??
Anyways, there are 2 ConnectException classes. Import 1 or both and check if any works!
http://docs.oracle.com/javase/7/docs/api/java/net/ConnectException.html
http://docs.oracle.com/javase/7/docs/api/java/rmi/ConnectException.html
@GoToLoop Thanks you and sorry for ThinkGearSocket.
Yes I tried both but both them are giving error. (mentioned above)
It is basically Neurosky Mindwave socket. Neurosky mindwave is a commercially available EEG sensor for researcher and developer monitering eeg signals (brainwave).
Earlier I have been working on this but then I started developing for kinect sensor now I have started again and find difficult to run my old code on processing.
[Edited]
but together it was not working :) thanks a lot GotoLoop
Since you're not sure what is the Exception class you need, how about catch-all? X_X
http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html
I've 1st said to import 1. By "both" I've meant try both. But forgot to warn you not at the same time! 8-X
And rather than a generic
import java.net.*;
, better be more specific:Either ->
import java.net.ConnectException;
orimport java.rmi.ConnectException;
.I doubt that's the RMI version, as it is a very specific protocol.