We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在定时关闭连接,或者在借出连接时,如果发现连接已经关闭,再去调用close方法,必然会出发这个错误,能否在连接关闭时做个判断,如果连接关闭时,就不调用 this.socket.getOutputStream().write(header);这一步了,避免打出一个标题错误日志。
public synchronized void close() { LOGGER.debug("disconnect from {}", this.socket); byte[] header = new byte[10]; Arrays.fill(header, (byte)0); byte[] hex_len = BytesUtil.long2buff(0L); System.arraycopy(hex_len, 0, header, 0, hex_len.length); header[8] = 82; header[9] = 0;
try { this.socket.getOutputStream().write(header); this.socket.close(); } catch (IOException var7) { LOGGER.error("close connection error", var7); } finally { IOUtils.closeQuietly(this.socket); } }
The text was updated successfully, but these errors were encountered:
研究了有一下,貌似是服务器主动断开了连接,FastDFS_Client没有收到断开事件,导致借出的连接时断开的,断开时又去this.socket.getOutputStream().write(header);导致报错,大佬研究过吗?服务器断开之前是不是也有事件推送的啊?
Sorry, something went wrong.
No branches or pull requests
在定时关闭连接,或者在借出连接时,如果发现连接已经关闭,再去调用close方法,必然会出发这个错误,能否在连接关闭时做个判断,如果连接关闭时,就不调用 this.socket.getOutputStream().write(header);这一步了,避免打出一个标题错误日志。
public synchronized void close() {
LOGGER.debug("disconnect from {}", this.socket);
byte[] header = new byte[10];
Arrays.fill(header, (byte)0);
byte[] hex_len = BytesUtil.long2buff(0L);
System.arraycopy(hex_len, 0, header, 0, hex_len.length);
header[8] = 82;
header[9] = 0;
The text was updated successfully, but these errors were encountered: