-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java版本套接字调用 Software caused connection abort: socket write error #106
Comments
jerrylususu
added a commit
to jerrylususu/PaddleOCR-json-java-api
that referenced
this issue
Aug 25, 2024
hi,我是 Java API 的维护者。首先很感谢你的反馈,我目前已经在新版本上根据你的反馈进行了修改。此外,paddleocr-json(本仓库)仅负责 paddleocr-json 本体的开发,各类语言的封装 API 的 issue 需要到各自的仓库反馈(如 https://github.com/jerrylususu/PaddleOCR-json-java-api )。欢迎后续的 issues 和 PR! |
java socket 客户端 依赖fastjson2
demo
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Java版本调用时,Ocr.class#sendJsonToOcr,writer.write(sw.getBuffer().toString());前面添加一段
if (OcrMode.SOCKET_SERVER == mode) {
writer.close();
reader.close();
clientSocket.close();
clientSocket = new Socket(serverAddr, serverPort);
clientSocket.setKeepAlive(true);
reader = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), StandardCharsets.UTF_8));
writer = new BufferedWriter(new OutputStreamWriter(clientSocket.getOutputStream(), StandardCharsets.UTF_8));
}
长连接第二次调用时会导致 Software caused connection abort: socket write error,所以套接字启动时改为短连接比较好
The text was updated successfully, but these errors were encountered: