Datasheet
API in Java
92
}
@Override
public void run() {
String s = "";
while (true) {
try {
s = aConn.getData();
if (s != null) {
t3A.outputHere(s);
if (s.contains("!done")) {
}
}
} catch (InterruptedException ex) {
Logger.getLogger(DataReceiver.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
Code
Code that is ready to be compiled and used. In some places some comments may be missing. Compiled jar file
[1]
of
same java classes
ApiConn.java
Main file of the package
package libAPI;
/*
* This contains connection. Everything should be here,
* should operate with this class only
*/
import java.io.*;
import java.net.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author janisk
*/
public class ApiConn extends Thread {
private Socket sock = null;










