Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C71EB200BF3 for ; Thu, 5 Jan 2017 13:57:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C5CE5160B26; Thu, 5 Jan 2017 12:57:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F2653160B4D for ; Thu, 5 Jan 2017 13:57:00 +0100 (CET) Received: (qmail 50265 invoked by uid 500); 5 Jan 2017 12:56:59 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 49845 invoked by uid 99); 5 Jan 2017 12:56:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2017 12:56:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D8B1C2C1F56 for ; Thu, 5 Jan 2017 12:56:58 +0000 (UTC) Date: Thu, 5 Jan 2017 12:56:58 +0000 (UTC) From: "zhengweixiong (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NET-606) Thread hangs when invoke connect method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Jan 2017 12:57:02 -0000 [ https://issues.apache.org/jira/browse/NET-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15801286#comment-15801286 ] zhengweixiong commented on NET-606: ----------------------------------- Thank you for your reply. 1. It hangs forever when the other connection try in other thread is ok. 2. this is the whole code sample. setSoTimeout can not be set before connect. I had try it. It can only be called after a connection has been opened. /** * Set the timeout in milliseconds of a currently open connection. * Only call this method after a connection has been opened * by {@link #connect connect()}. *

* @param timeout The timeout in milliseconds to use for the currently * open socket connection. * @exception SocketException If the operation fails. */ public void setSoTimeout(int timeout) throws SocketException maybe this is the issue is. > Thread hangs when invoke connect method > --------------------------------------- > > Key: NET-606 > URL: https://issues.apache.org/jira/browse/NET-606 > Project: Commons Net > Issue Type: Bug > Components: FTP > Affects Versions: 2.2 > Reporter: zhengweixiong > Priority: Minor > Original Estimate: 96h > Remaining Estimate: 96h > > ftp hangs when trying connect. stack as follows. > {noformat} > "UpdateBrowSerParam" #633 prio=5 os_prio=0 tid=0x00007f60610cc000 nid=0x2165 runnable [0x00007f6037403000] > java.lang.Thread.State: RUNNABLE > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) > at java.net.SocketInputStream.read(SocketInputStream.java:170) > at java.net.SocketInputStream.read(SocketInputStream.java:141) > at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) > at sun.security.ssl.InputRecord.read(InputRecord.java:503) > at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) > - locked <0x00000006d44fdd70> (a java.lang.Object) > at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) > - locked <0x00000006d44fdda0> (a java.lang.Object) > at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) > at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) > at org.apache.commons.net.ftp.FTPSClient.sslNegotiation(FTPSClient.java:263) > at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:192) > at org.apache.commons.net.SocketClient.connect(SocketClient.java:164) > at org.apache.commons.net.SocketClient.connect(SocketClient.java:184) > at com.swimap.prs.utils.ftp.FTPSTransfer.initFTPSClient(FTPSTransfer.java:96) > at com.swimap.prs.utils.ftp.FTPSTransfer.initFtpsClient(FTPSTransfer.java:336) > at com.swimap.prs.utils.ftp.FTPSTransfer.upload(FTPSTransfer.java:236) > at com.swimap.prs.application.paimgr.session.impl.TransferFileService.uploadFile(TransferFileService.java:57) > {noformat} > this issue happen something when the other times is ok. > code as follows: > {code} > ftps = new FTPSClient("TLSv1.2", true); > ftps.setConnectTimeout(10000); > ftps.setDataTimeout(20000); > ftps.setControlEncoding("UTF-8"); > ftps.connect(ftpServerInfo.getIp()); > ftps.setSoTimeout(20000); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)