Tag: fileapi

Websocket文件上传速度问题(Java websocket API和Javascript)

我几乎没有做过websocket文件上传function。 但上传速度似乎很慢。 我已经使用Java API for websocket Server和javascript for client。 服务器: package websocket; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import javax.websocket.CloseReason; import javax.websocket.EndpointConfig; import javax.websocket.OnClose; import javax.websocket.OnError; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; @ServerEndpoint(“/receive/fileserver”) public class FileServer { static File uploadedFile = null; static String fileName = null; static FileOutputStream […]