warning | JWAVE uses an insecure protocol without authentication. This makes JWAVE insecure to use in an Internet facing configuration and would allow an attacker to execute arbitrary code on the server. If you choose to implement JWAVE in this way, you are responsible for the security of those applications that leverage JWAVE. |
FUNCTION PASSFFT, client_data
; Get the data from the client.
arr = GETPARAM(client_data, 'ARRAY', /Value)
;Process the data, creating two separate variable results
freq = FLOAT(ABS(FFT(arr, -1)))
distrib = HISTOGRAM(freq)
; Create associative array to send results back to the client.
RETURN, ASARR('FDATA', freq, 'HIST', distrib)
END
Client calls to unpack associative array sent from the server.
//Get the FFT data
float[] d = (float[]) command.getReturnData(”FDATA”);
//Get the histogram data
int[] h = (int[]) command.getReturnData(”HIST”);