Stream Binary data to javascript html from Java ServerSocket -


i trying stream binary data, html page using java server built using serversocket. able achieve using xmlhttprequest, observing big delay in receiving end. please share better way same avoid delay. built websocket server using java not able receive data binary in javascript.

i assume didn't specify content length of binary stream and/or not close servlet output stream. please consider following code

    protected void doget(httpservletrequest request,httpservletresponse response)  throws servletexception, ioexception {        byte[] binarydata = createbinarycontent();        outputstream out = response.getoutputstream();        response.setcontenttype("application/octet-stream");        response.setcontentlength(binarydata.length);        out.write(binarydata);        out.close();     }   

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -